Frans Bergman 2 years ago
parent
commit
f4a7e945aa
2 changed files with 234 additions and 0 deletions
  1. 147 0
      14.input
  2. 87 0
      14.py

+ 147 - 0
14.input

@@ -0,0 +1,147 @@
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+541,165 -> 541,166 -> 551,166 -> 551,165
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+541,165 -> 541,166 -> 551,166 -> 551,165
+565,161 -> 569,161
+483,51 -> 483,52 -> 500,52 -> 500,51
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+506,84 -> 510,84
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+512,80 -> 516,80
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+512,84 -> 516,84
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+509,82 -> 513,82
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+553,161 -> 557,161
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+554,133 -> 558,133
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+551,136 -> 555,136
+563,136 -> 567,136
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+517,95 -> 522,95
+503,86 -> 507,86
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+559,155 -> 563,155
+521,86 -> 525,86
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+519,98 -> 519,99 -> 529,99 -> 529,98
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+483,51 -> 483,52 -> 500,52 -> 500,51
+515,86 -> 519,86
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+483,51 -> 483,52 -> 500,52 -> 500,51
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+519,98 -> 519,99 -> 529,99 -> 529,98
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+519,98 -> 519,99 -> 529,99 -> 529,98
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+557,130 -> 561,130
+518,84 -> 522,84
+545,127 -> 558,127
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+556,152 -> 560,152
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+559,161 -> 563,161
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+541,165 -> 541,166 -> 551,166 -> 551,165
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+509,86 -> 513,86
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+484,48 -> 484,43 -> 484,48 -> 486,48 -> 486,38 -> 486,48 -> 488,48 -> 488,43 -> 488,48 -> 490,48 -> 490,45 -> 490,48 -> 492,48 -> 492,40 -> 492,48
+520,92 -> 525,92
+556,158 -> 560,158
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+553,155 -> 557,155
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+562,158 -> 566,158
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+550,158 -> 554,158
+515,82 -> 519,82
+557,136 -> 561,136
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+547,161 -> 551,161
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+531,95 -> 536,95
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+527,92 -> 532,92
+523,89 -> 528,89
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+499,13 -> 499,15 -> 495,15 -> 495,22 -> 506,22 -> 506,15 -> 501,15 -> 501,13
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+541,149 -> 541,141 -> 541,149 -> 543,149 -> 543,144 -> 543,149 -> 545,149 -> 545,144 -> 545,149 -> 547,149 -> 547,148 -> 547,149 -> 549,149 -> 549,144 -> 549,149 -> 551,149 -> 551,141 -> 551,149 -> 553,149 -> 553,147 -> 553,149 -> 555,149 -> 555,146 -> 555,149 -> 557,149 -> 557,147 -> 557,149
+527,102 -> 527,106 -> 523,106 -> 523,111 -> 540,111 -> 540,106 -> 533,106 -> 533,102
+490,35 -> 490,31 -> 490,35 -> 492,35 -> 492,31 -> 492,35 -> 494,35 -> 494,29 -> 494,35 -> 496,35 -> 496,26 -> 496,35
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65
+560,133 -> 564,133
+506,68 -> 506,70 -> 502,70 -> 502,77 -> 513,77 -> 513,70 -> 512,70 -> 512,68
+538,114 -> 538,116 -> 536,116 -> 536,122 -> 552,122 -> 552,116 -> 544,116 -> 544,114
+524,95 -> 529,95
+492,65 -> 492,64 -> 492,65 -> 494,65 -> 494,59 -> 494,65 -> 496,65 -> 496,64 -> 496,65 -> 498,65 -> 498,62 -> 498,65 -> 500,65 -> 500,63 -> 500,65 -> 502,65 -> 502,59 -> 502,65 -> 504,65 -> 504,64 -> 504,65 -> 506,65 -> 506,63 -> 506,65 -> 508,65 -> 508,63 -> 508,65

+ 87 - 0
14.py

@@ -0,0 +1,87 @@
+lines = [line.strip() for line in open("14.input")]
+
+rocks = set()
+
+for line in lines:
+    coords = line.split(" -> ")
+    for i in range(0, len(coords) - 1):
+        start = list(map(int, coords[i].split(",")))
+        end = list(map(int, coords[i+1].split(",")))
+        if start[0] == end[0]:
+            for y in range(min(start[1], end[1]), max(start[1], end[1]) + 1):
+                rocks.add((start[0], y))
+        else:
+            for x in range(min(start[0], end[0]), max(start[0], end[0]) + 1):
+                rocks.add((x, start[1]))
+
+def draw_grid(rocks, sands):
+    obst = rocks.union(sands)
+    min_x = min(o[0] for o in sands)
+    max_x = max(o[0] for o in sands)
+    max_y = max(o[1] for o in obst)
+    for y in range(0, max_y+1):
+        for x in range(min_x, max_x):
+            if (x, y) in rocks:
+                print("#", end="")
+            elif (x, y) in sands:
+                print("o", end="")
+            else:
+                print(".", end="")
+        print("")
+
+def step(rocks, sands, bottom):
+    obst = rocks.union(sands)
+
+    sand = (500, 0)
+
+    if sand in sands:
+        return sands
+
+    while True:
+        if sand[1] > bottom:
+            return sands
+        targets = [
+           (sand[0], sand[1] + 1),
+           (sand[0] - 1, sand[1] + 1),
+           (sand[0] + 1, sand[1] + 1),
+           ]
+        for t in targets:
+            if t not in obst:
+                sand = t
+                break
+        else:
+            break
+
+    sands.add(sand)
+    return sands
+
+def part1():
+    sands = set()
+    bottom = max(r[1] for r in rocks)
+
+    while True:
+        l = len(sands)
+        sands = step(rocks, sands, bottom)
+        if l == len(sands):
+            break
+
+    print(len(sands))
+
+part1()
+
+def part2():
+    sands = set()
+    bottom = max(r[1] for r in rocks) + 2
+
+    for x in range(-1000, 1000):
+        rocks.add((x, bottom))
+
+    while True:
+        l = len(sands)
+        sands = step(rocks, sands, bottom)
+        if l == len(sands):
+            break
+
+    print(len(sands))
+
+part2()