~cdv/aoc-2018-rs

6725a1a9f3ec81893a0261116600c40adb951862 — Christopher Vittal 2 years ago 49f8113 day17
Solve day seventeen
3 files changed, 2447 insertions(+), 1 deletions(-)

A data/day17
A descriptions/Day17.md
M src/bin/day17.rs
A data/day17 => data/day17 +2130 -0
@@ 0,0 1,2130 @@
x=360, y=75..98
x=579, y=819..844
y=1262, x=362..366
x=573, y=1593..1621
y=1546, x=508..510
x=284, y=1687..1696
y=1793, x=383..386
x=506, y=254..256
x=414, y=337..361
x=375, y=682..688
x=606, y=974..991
x=504, y=1502..1517
x=347, y=233..242
y=181, x=524..526
y=1419, x=635..653
x=338, y=567..577
y=1583, x=525..545
y=968, x=387..389
y=1617, x=444..462
x=538, y=891..917
y=1073, x=364..366
x=309, y=1273..1289
x=619, y=894..903
x=676, y=817..820
x=567, y=1185..1191
x=406, y=766..776
x=489, y=1351..1357
x=497, y=1173..1178
x=453, y=924..934
x=655, y=1161..1188
y=1698, x=667..672
x=319, y=845..847
x=377, y=848..859
y=1090, x=594..596
y=389, x=576..597
x=651, y=600..611
x=404, y=1590..1593
x=643, y=895..903
x=319, y=1629..1639
x=414, y=270..274
x=490, y=1633..1642
x=298, y=701..710
x=380, y=1125..1135
x=609, y=457..459
x=470, y=383..401
x=477, y=228..243
y=1095, x=336..339
y=164, x=627..633
x=334, y=285..307
y=773, x=633..642
x=646, y=413..415
x=658, y=1398..1425
y=1400, x=663..667
x=297, y=1786..1797
y=284, x=305..321
x=356, y=1817..1826
y=947, x=398..423
x=403, y=892..902
x=605, y=27..38
x=554, y=143..164
x=654, y=130..152
x=578, y=516..525
x=548, y=1430..1438
y=900, x=604..612
x=416, y=720..733
y=1485, x=554..582
x=325, y=1239..1246
y=84, x=665..682
x=440, y=112..119
x=298, y=636..653
y=577, x=338..358
y=672, x=618..637
x=415, y=607..619
y=581, x=271..276
x=504, y=115..126
y=667, x=271..275
x=435, y=1465..1482
y=1795, x=561..580
x=276, y=276..292
x=559, y=758..770
x=472, y=90..100
y=139, x=335..355
x=424, y=885..907
x=553, y=1294..1296
x=643, y=273..290
x=516, y=1094..1098
x=383, y=1111..1113
x=592, y=620..643
y=1017, x=443..460
x=636, y=989..1000
x=488, y=1095..1098
x=625, y=1294..1320
x=551, y=1048..1067
y=315, x=615..634
y=1665, x=349..360
y=90, x=563..574
x=423, y=936..947
x=319, y=869..872
x=642, y=36..41
x=469, y=452..462
x=297, y=1481..1490
x=476, y=1728..1752
y=1593, x=377..404
x=668, y=591..600
x=299, y=1812..1817
x=282, y=306..311
x=563, y=398..411
x=677, y=1633..1639
x=616, y=820..836
x=666, y=274..290
x=544, y=673..694
y=332, x=351..374
y=21, x=418..420
y=317, x=477..479
x=357, y=197..210
x=579, y=860..884
x=398, y=1020..1033
y=201, x=389..395
x=487, y=1229..1241
y=1479, x=446..448
x=509, y=20..27
x=307, y=1425..1434
x=407, y=1775..1783
x=592, y=294..302
y=426, x=310..325
x=414, y=1067..1077
y=64, x=300..304
y=754, x=406..426
x=303, y=513..522
y=844, x=579..595
x=317, y=483..489
x=491, y=1228..1241
x=550, y=1138..1149
x=341, y=232..242
x=554, y=1170..1177
y=1296, x=538..553
y=1005, x=352..368
x=633, y=760..773
x=337, y=1193..1200
y=660, x=374..396
x=393, y=874..878
x=325, y=1634..1636
x=606, y=1236..1250
x=666, y=933..944
y=884, x=579..601
y=1182, x=483..504
y=1552, x=501..518
y=133, x=403..413
x=659, y=1625..1645
x=684, y=1461..1488
x=366, y=703..729
y=764, x=288..310
y=319, x=477..479
x=290, y=1062..1088
x=508, y=887..901
x=428, y=915..925
x=335, y=356..378
y=602, x=612..616
x=417, y=607..619
x=413, y=570..580
y=801, x=275..278
x=648, y=1329..1332
x=461, y=1550..1574
x=340, y=209..213
x=425, y=1001..1013
x=610, y=1401..1403
y=1549, x=311..328
y=1068, x=661..688
x=591, y=253..263
x=424, y=188..210
x=383, y=1192..1203
x=534, y=1052..1058
x=657, y=1546..1556
y=874, x=388..393
x=573, y=226..238
y=1616, x=657..664
x=625, y=1670..1673
x=639, y=923..927
x=300, y=879..904
y=1135, x=373..380
y=931, x=458..470
x=634, y=1425..1448
y=318, x=500..537
y=841, x=585..587
y=157, x=445..447
x=559, y=329..342
y=1229, x=647..652
y=73, x=515..518
y=213, x=340..344
x=379, y=295..302
y=1371, x=518..536
x=574, y=360..365
y=925, x=410..428
y=136, x=398..424
x=321, y=1026..1051
x=410, y=1410..1424
x=499, y=947..961
x=310, y=1235..1260
x=604, y=280..295
x=657, y=282..287
x=381, y=870..884
x=646, y=552..562
y=1825, x=645..658
y=1225, x=419..441
x=670, y=1161..1188
y=355, x=509..535
x=306, y=598..616
x=447, y=141..157
x=565, y=1759..1770
x=320, y=212..233
y=1765, x=380..383
x=618, y=704..714
x=678, y=320..334
y=935, x=590..615
y=892, x=514..517
x=462, y=1592..1617
x=306, y=1808..1821
x=494, y=626..651
x=525, y=1227..1255
x=322, y=537..547
x=348, y=258..278
y=1758, x=360..364
x=405, y=1065..1073
x=292, y=508..536
x=322, y=1664..1674
y=1445, x=624..628
x=362, y=1258..1262
x=677, y=1358..1378
x=427, y=312..315
y=979, x=410..430
x=399, y=1677..1686
x=409, y=983..994
x=384, y=220..240
x=518, y=1368..1371
y=714, x=618..642
x=669, y=656..661
x=530, y=1255..1264
y=1639, x=673..677
x=309, y=1560..1570
y=1639, x=319..335
x=651, y=1713..1735
y=747, x=412..417
y=575, x=419..421
x=430, y=1523..1525
x=353, y=1212..1224
y=1595, x=294..319
x=673, y=1633..1639
x=640, y=1669..1673
x=415, y=1122..1139
x=296, y=1668..1680
x=364, y=1469..1478
y=259, x=495..514
y=710, x=298..314
x=297, y=1075..1091
y=878, x=388..393
x=338, y=942..962
y=295, x=373..379
x=453, y=1697..1721
y=1705, x=477..488
y=16, x=493..495
y=1701, x=321..346
x=433, y=610..623
x=360, y=271..280
y=1150, x=680..684
y=1309, x=449..469
x=459, y=763..768
y=1784, x=504..512
x=308, y=1741..1751
x=547, y=1089..1099
y=1443, x=472..489
x=487, y=764..772
y=268, x=657..683
y=1364, x=575..581
x=504, y=254..256
y=653, x=298..302
x=418, y=912..921
y=622, x=405..423
y=1455, x=318..335
y=948, x=348..350
x=287, y=1687..1696
y=526, x=445..466
x=479, y=93..96
x=395, y=1524..1549
x=428, y=803..807
x=615, y=1359..1383
y=1251, x=390..402
x=368, y=1721..1724
x=642, y=1831..1835
x=289, y=1726..1736
x=636, y=6..14
x=379, y=1774..1783
y=33, x=657..659
x=360, y=1653..1665
x=422, y=707..714
x=373, y=1721..1724
x=307, y=1409..1413
y=1735, x=651..664
y=415, x=644..646
y=942, x=404..416
x=418, y=1149..1151
x=339, y=1028..1032
x=389, y=189..201
x=620, y=425..444
y=97, x=655..676
x=475, y=627..629
y=823, x=309..311
x=575, y=1339..1364
x=364, y=1747..1758
x=298, y=1743..1756
y=837, x=373..391
y=1619, x=306..327
y=1319, x=537..551
x=567, y=1002..1027
y=84, x=321..348
y=177, x=674..690
x=492, y=1173..1178
x=607, y=1822..1828
y=1776, x=615..640
x=407, y=1222..1224
x=650, y=1515..1527
x=403, y=131..133
x=396, y=1223..1224
y=836, x=616..618
x=362, y=343..361
y=1169, x=454..464
x=654, y=636..647
x=661, y=7..14
y=559, x=632..638
x=388, y=60..69
x=271, y=1192..1206
y=1687, x=643..671
x=457, y=828..841
y=1016, x=316..335
y=1279, x=409..417
y=500, x=366..372
x=624, y=1782..1785
x=291, y=1501..1510
x=352, y=989..1005
y=991, x=591..606
y=1311, x=333..382
x=596, y=122..134
x=501, y=1540..1552
x=661, y=924..927
x=674, y=973..988
x=572, y=102..110
x=541, y=1157..1162
x=304, y=560..584
x=358, y=159..161
x=395, y=1068..1077
x=665, y=63..84
y=315, x=427..444
x=320, y=1321..1331
x=425, y=1038..1043
x=585, y=139..146
y=859, x=377..393
y=1375, x=299..317
x=308, y=1765..1778
x=561, y=418..430
x=629, y=656..669
y=1319, x=581..607
x=414, y=292..300
x=282, y=1809..1821
y=1821, x=282..306
x=312, y=408..414
y=1383, x=615..633
x=618, y=741..746
x=411, y=1250..1256
x=287, y=54..72
x=565, y=329..342
x=458, y=471..481
x=602, y=373..396
x=467, y=828..841
x=553, y=1549..1557
x=312, y=1425..1434
x=408, y=871..884
x=598, y=123..134
y=1044, x=547..575
x=277, y=1588..1593
x=647, y=574..576
y=647, x=637..654
x=388, y=289..306
y=847, x=498..525
y=958, x=348..350
x=388, y=982..994
y=21, x=484..501
y=804, x=578..597
y=1639, x=454..466
y=139, x=663..665
x=469, y=1286..1309
x=292, y=275..292
x=461, y=23..25
y=238, x=554..573
x=370, y=772..786
x=605, y=567..577
x=380, y=196..210
y=1032, x=337..339
y=615, x=580..589
x=449, y=1286..1309
y=1416, x=645..647
x=393, y=847..859
x=683, y=259..268
x=314, y=1744..1756
y=485, x=452..469
x=390, y=1105..1116
x=380, y=167..169
x=651, y=1442..1448
x=611, y=1425..1448
y=577, x=419..421
x=311, y=821..823
x=427, y=230..247
x=654, y=496..510
y=1264, x=530..545
x=652, y=1214..1229
x=417, y=1352..1356
y=1298, x=420..429
x=483, y=1321..1341
x=365, y=222..233
x=306, y=660..688
y=902, x=401..403
y=1383, x=638..659
x=365, y=1217..1221
x=559, y=1139..1149
y=242, x=341..347
x=424, y=123..136
y=493, x=518..539
x=349, y=355..378
x=612, y=891..900
y=263, x=570..591
y=1672, x=644..654
x=593, y=657..680
x=594, y=1593..1621
y=901, x=508..528
x=396, y=17..42
y=1289, x=284..309
x=649, y=1471..1473
x=425, y=804..807
y=1014, x=509..532
x=358, y=676..692
y=561, x=424..443
y=1451, x=639..664
x=419, y=1123..1139
x=603, y=1498..1525
y=1069, x=506..524
x=286, y=1665..1675
y=547, x=302..322
x=358, y=52..65
y=1247, x=542..567
x=483, y=435..445
x=548, y=1805..1813
y=1188, x=655..670
x=423, y=1356..1360
x=422, y=1664..1671
x=272, y=963..970
y=1368, x=275..278
x=378, y=957..971
x=294, y=1581..1595
y=1529, x=293..311
x=632, y=280..295
x=313, y=376..383
x=563, y=568..581
x=638, y=1517..1527
y=297, x=505..560
y=619, x=415..417
x=368, y=1591..1614
x=364, y=1068..1073
x=525, y=824..847
y=1552, x=665..667
x=689, y=739..760
x=554, y=1470..1485
y=1454, x=406..421
x=381, y=1278..1283
x=409, y=434..440
x=673, y=1546..1556
x=498, y=824..847
x=683, y=460..472
y=21, x=562..586
y=1033, x=398..400
x=415, y=970..974
y=1213, x=450..464
y=240, x=378..384
y=1448, x=611..634
x=657, y=259..268
y=600, x=387..389
y=620, x=657..659
y=643, x=582..592
x=307, y=1483..1493
x=565, y=1234..1236
y=683, x=492..505
x=281, y=509..536
x=645, y=1414..1416
x=376, y=915..924
y=38, x=605..614
x=492, y=1214..1220
y=345, x=554..574
x=522, y=13..19
y=1536, x=404..420
x=328, y=1647..1659
x=677, y=353..375
x=554, y=331..345
y=758, x=476..503
x=483, y=1292..1295
y=302, x=373..379
y=1778, x=667..671
x=586, y=566..577
x=477, y=962..990
y=145, x=531..550
x=533, y=174..184
y=481, x=614..633
y=1631, x=584..609
x=635, y=570..582
x=378, y=221..240
y=970, x=272..299
x=324, y=1023..1045
x=336, y=1076..1095
x=616, y=1509..1520
y=1055, x=411..415
x=545, y=1254..1264
y=1224, x=396..407
x=389, y=595..600
y=1139, x=415..419
x=607, y=711..713
x=672, y=828..832
y=792, x=421..435
y=142, x=663..665
x=443, y=999..1017
x=524, y=13..19
x=517, y=175..184
y=573, x=312..314
x=578, y=257..259
x=601, y=861..884
x=288, y=1484..1493
x=521, y=1813..1835
y=1488, x=668..684
x=420, y=1529..1536
y=1649, x=427..449
x=671, y=817..820
x=434, y=1582..1587
x=614, y=471..481
y=847, x=319..325
x=533, y=8..22
x=586, y=1466..1493
x=525, y=1579..1583
y=577, x=586..605
y=543, x=347..361
x=406, y=189..210
x=495, y=1633..1642
x=578, y=780..804
x=632, y=238..262
x=325, y=1363..1368
y=1449, x=411..415
x=621, y=1509..1520
y=1721, x=312..332
x=405, y=1522..1525
x=623, y=1470..1473
x=568, y=568..581
x=574, y=1649..1672
y=327, x=589..616
y=1690, x=575..578
x=361, y=528..543
x=642, y=60..73
x=511, y=20..27
x=646, y=796..823
x=675, y=460..472
y=708, x=626..631
x=439, y=764..768
x=644, y=574..576
x=416, y=292..300
x=630, y=991..993
x=277, y=180..185
y=940, x=675..678
x=644, y=344..360
x=672, y=1694..1698
y=1473, x=623..649
y=1200, x=323..337
x=599, y=1726..1736
x=435, y=784..792
x=398, y=958..971
y=1075, x=471..489
x=564, y=763..766
x=335, y=994..1016
x=481, y=93..96
x=663, y=591..600
x=637, y=658..672
x=578, y=1678..1690
x=569, y=1207..1221
y=1265, x=341..386
y=1545, x=594..615
x=317, y=1536..1545
y=1574, x=454..461
x=669, y=1227..1242
x=367, y=172..179
y=1157, x=599..619
y=65, x=358..378
x=348, y=1385..1397
x=510, y=67..80
x=432, y=1369..1389
x=524, y=157..160
x=650, y=1122..1136
x=315, y=213..233
y=392, x=395..422
x=296, y=1137..1139
x=320, y=1360..1374
y=996, x=434..458
x=643, y=1682..1687
x=682, y=165..167
x=669, y=932..944
x=686, y=209..214
x=520, y=274..279
x=614, y=237..262
y=752, x=542..545
y=1241, x=487..491
x=627, y=873..883
x=627, y=131..140
y=192, x=670..675
y=622, x=657..659
x=319, y=1342..1344
y=936, x=488..492
x=580, y=1789..1795
x=658, y=1798..1825
x=488, y=926..936
x=635, y=1745..1749
x=575, y=1034..1044
x=404, y=1089..1092
y=120, x=515..518
x=656, y=354..375
x=659, y=620..622
x=661, y=1067..1068
x=615, y=305..315
y=1263, x=635..651
x=312, y=566..573
y=1671, x=410..422
y=1514, x=451..463
y=625, x=648..665
x=600, y=772..787
x=414, y=707..714
y=1292, x=483..488
x=418, y=13..21
x=349, y=1652..1665
x=284, y=335..346
y=454, x=342..355
x=618, y=637..645
x=310, y=1409..1413
x=453, y=20..45
y=437, x=331..343
x=567, y=1240..1247
x=599, y=457..459
y=755, x=632..642
y=60, x=498..517
x=539, y=595..597
y=1673, x=598..616
y=850, x=314..333
x=320, y=640..652
y=581, x=563..568
x=528, y=886..901
x=572, y=1549..1557
x=607, y=753..759
x=582, y=354..368
x=617, y=988..1000
x=614, y=26..38
x=458, y=518..520
x=390, y=1170..1183
x=492, y=1729..1752
x=503, y=754..758
x=380, y=353..356
y=154, x=394..403
x=446, y=1373..1375
x=285, y=285..289
y=1301, x=683..688
x=409, y=1493..1502
x=351, y=1232..1245
y=282, x=651..657
x=634, y=306..315
y=368, x=563..582
x=632, y=872..883
y=799, x=393..415
x=316, y=1407..1416
x=519, y=153..166
x=577, y=419..430
y=243, x=477..484
y=342, x=559..565
x=385, y=845..854
x=475, y=23..25
y=430, x=561..577
y=1452, x=582..597
x=517, y=49..60
x=506, y=228..241
y=136, x=477..483
x=617, y=37..41
x=581, y=1316..1319
y=110, x=566..572
x=464, y=1147..1169
y=167, x=682..684
y=1517, x=504..518
y=322, x=494..572
x=313, y=660..688
y=37, x=536..542
x=343, y=701..708
x=377, y=702..729
x=631, y=708..711
x=407, y=1320..1331
x=664, y=1440..1451
x=647, y=1414..1416
y=1026, x=485..492
y=1593, x=277..290
x=640, y=1326..1350
x=515, y=596..597
y=1221, x=359..365
x=458, y=927..931
x=564, y=1649..1672
x=633, y=1293..1320
y=247, x=641..660
x=597, y=781..804
x=665, y=139..142
y=1139, x=296..318
x=534, y=1470..1473
x=318, y=1427..1437
x=497, y=1340..1351
x=620, y=452..462
x=678, y=924..940
x=393, y=788..799
x=449, y=1736..1739
x=417, y=747..750
x=368, y=326..329
x=376, y=158..161
x=288, y=1832..1837
x=504, y=880..889
x=420, y=912..921
x=384, y=825..834
x=418, y=999..1007
y=1570, x=309..327
x=298, y=1689..1699
y=505, x=459..479
x=532, y=742..766
x=466, y=515..526
x=576, y=377..389
x=461, y=144..165
y=766, x=508..532
x=389, y=955..968
x=514, y=889..892
y=669, x=629..631
x=554, y=208..219
y=1658, x=515..517
y=1088, x=280..290
y=1659, x=369..385
y=279, x=496..516
x=437, y=680..691
x=409, y=1002..1013
x=619, y=1398..1408
x=325, y=419..426
x=651, y=1249..1263
x=642, y=742..755
x=415, y=385..387
y=303, x=401..422
y=1686, x=394..399
y=510, x=654..658
x=454, y=1629..1639
x=430, y=554..557
x=686, y=861..882
x=330, y=1666..1680
x=382, y=845..854
x=294, y=1829..1841
x=288, y=779..806
y=208, x=633..655
x=508, y=1610..1613
y=1526, x=594..600
x=375, y=353..356
y=467, x=305..325
x=542, y=22..37
x=459, y=496..505
x=574, y=332..345
x=506, y=1064..1069
y=57, x=504..508
y=120, x=533..547
y=1751, x=304..308
y=1256, x=411..423
y=584, x=304..320
x=311, y=1667..1680
y=1613, x=451..456
x=420, y=13..21
x=472, y=1570..1590
y=1479, x=524..540
x=347, y=1470..1478
x=415, y=1176..1179
y=971, x=378..398
x=583, y=1427..1432
x=686, y=997..1022
x=534, y=829..837
y=279, x=520..541
x=639, y=1439..1451
x=386, y=1253..1265
x=446, y=1476..1479
y=361, x=362..389
x=298, y=252..255
x=567, y=1475..1478
x=567, y=158..160
x=356, y=591..619
y=1490, x=297..300
x=570, y=516..525
y=1389, x=432..452
x=380, y=1759..1765
x=485, y=1001..1026
x=616, y=287..292
x=667, y=997..1022
y=645, x=612..618
y=165, x=461..483
x=521, y=627..651
x=415, y=1440..1449
x=374, y=322..332
x=607, y=302..305
x=516, y=9..22
y=383, x=300..313
x=526, y=1408..1436
x=418, y=220..241
x=469, y=107..119
x=321, y=1687..1701
y=1356, x=400..417
x=367, y=1233..1245
x=476, y=1287..1300
x=618, y=659..672
y=604, x=656..676
x=628, y=991..993
x=403, y=1065..1073
x=379, y=1048..1055
x=451, y=1601..1613
y=1721, x=431..453
x=504, y=1764..1784
y=1076, x=357..372
y=611, x=644..651
x=518, y=1502..1517
x=604, y=1070..1093
y=186, x=579..590
x=462, y=471..481
y=834, x=631..633
x=488, y=1292..1295
y=14, x=636..661
x=300, y=1105..1121
y=481, x=458..462
y=262, x=614..632
x=379, y=1719..1728
y=786, x=360..370
x=575, y=1679..1690
x=302, y=636..653
x=574, y=671..675
x=471, y=1068..1075
x=537, y=316..318
x=688, y=188..204
y=900, x=651..677
x=431, y=122..145
x=307, y=1467..1476
y=445, x=483..607
x=295, y=605..609
y=294, x=483..485
x=421, y=1434..1454
y=1545, x=317..321
y=300, x=414..416
y=536, x=281..292
y=22, x=516..533
x=502, y=968..985
x=627, y=158..164
x=657, y=1009..1030
y=56, x=369..371
x=452, y=1370..1389
x=425, y=79..88
x=469, y=1261..1273
y=675, x=570..574
x=662, y=871..886
x=372, y=1064..1076
y=841, x=457..467
y=544, x=433..644
x=278, y=1690..1699
y=1013, x=409..425
x=335, y=1629..1639
y=336, x=334..337
x=680, y=91..97
x=565, y=1157..1162
x=500, y=316..318
x=678, y=189..204
y=1387, x=373..392
y=1378, x=675..677
x=585, y=301..311
x=532, y=1470..1473
x=514, y=249..259
y=1756, x=298..314
x=675, y=925..940
y=1177, x=551..554
y=1502, x=532..541
y=1674, x=319..322
y=158, x=567..569
y=119, x=469..471
y=1566, x=367..378
y=88, x=411..425
x=330, y=1466..1476
x=589, y=502..503
y=1406, x=377..402
x=535, y=194..203
x=657, y=26..33
y=1621, x=573..594
x=327, y=1442..1452
y=576, x=644..647
x=452, y=1684..1689
y=760, x=664..689
x=302, y=537..547
x=487, y=90..100
y=629, x=475..482
x=667, y=1693..1698
y=1357, x=462..489
x=664, y=740..760
x=682, y=64..84
x=321, y=1536..1545
x=441, y=338..361
x=609, y=964..976
y=360, x=628..644
x=642, y=705..714
y=1672, x=564..574
x=318, y=1247..1255
y=557, x=430..432
y=503, x=577..589
x=321, y=59..84
x=395, y=188..201
x=561, y=1789..1795
y=1642, x=527..542
x=589, y=599..615
x=594, y=1542..1545
y=356, x=375..380
y=1556, x=657..673
y=1403, x=603..610
x=326, y=393..408
x=306, y=1366..1369
y=924, x=376..386
y=1369, x=306..311
x=401, y=481..490
y=694, x=629..685
y=1331, x=320..407
y=353, x=375..380
x=476, y=753..758
y=1341, x=473..483
y=1178, x=492..497
y=1544, x=508..510
x=355, y=443..454
x=675, y=1358..1378
x=655, y=827..832
x=660, y=229..247
y=72, x=287..310
y=1770, x=565..579
x=289, y=1235..1260
x=637, y=636..647
x=393, y=894..905
x=577, y=501..503
y=1236, x=565..575
x=314, y=566..573
x=299, y=948..952
y=1206, x=271..274
x=684, y=165..167
x=434, y=1782..1807
x=477, y=123..136
x=290, y=1587..1593
y=233, x=315..320
y=1414, x=463..468
x=533, y=1291..1300
y=623, x=433..454
y=711, x=626..631
y=99, x=300..314
x=410, y=958..979
x=450, y=1194..1213
x=441, y=1208..1225
y=691, x=437..439
x=398, y=937..947
x=629, y=683..694
y=1452, x=325..327
y=1826, x=345..356
y=708, x=343..356
x=445, y=112..119
y=962, x=338..356
x=439, y=680..691
x=360, y=1747..1758
y=1645, x=659..683
x=383, y=1086..1098
x=422, y=1046..1060
x=301, y=353..360
y=886, x=656..662
x=392, y=1023..1036
y=185, x=277..285
y=1594, x=640..663
x=509, y=330..355
x=327, y=1634..1636
x=424, y=552..561
x=624, y=89..99
y=1068, x=364..366
x=318, y=1137..1139
x=426, y=741..754
y=1828, x=587..607
x=319, y=1558..1567
x=667, y=656..661
y=1200, x=373..377
x=278, y=796..801
y=770, x=559..574
x=547, y=110..120
x=646, y=1442..1448
y=241, x=506..544
x=545, y=1167..1193
x=589, y=138..146
x=607, y=1315..1319
y=1751, x=522..535
x=338, y=1694..1698
x=391, y=827..837
x=542, y=892..917
x=478, y=763..772
y=1242, x=664..669
x=370, y=1106..1116
x=411, y=1619..1621
y=1627, x=612..619
x=404, y=483..498
x=380, y=1111..1113
y=824, x=655..682
x=601, y=742..746
x=312, y=1092..1095
x=299, y=1428..1437
x=654, y=652..664
y=884, x=381..408
x=655, y=187..208
x=505, y=286..297
y=1203, x=364..383
x=540, y=1409..1436
y=1043, x=412..425
x=517, y=1143..1154
y=99, x=614..624
x=360, y=771..786
x=400, y=763..773
x=657, y=620..622
y=634, x=467..488
x=614, y=88..99
x=460, y=1000..1017
x=322, y=1342..1344
x=409, y=1272..1279
x=622, y=956..960
x=615, y=1543..1545
x=288, y=599..616
x=556, y=79..102
x=486, y=1569..1590
x=495, y=5..16
x=469, y=1250..1254
y=600, x=663..668
y=1093, x=586..604
x=589, y=1105..1109
x=366, y=1171..1183
x=485, y=287..294
x=537, y=290..293
y=1673, x=625..640
x=529, y=157..160
x=644, y=1653..1672
x=597, y=377..389
y=1483, x=463..480
x=383, y=1789..1793
y=1273, x=442..469
x=350, y=572..574
x=533, y=110..120
y=1179, x=415..441
x=421, y=575..577
x=345, y=1022..1045
y=751, x=678..681
y=1728, x=358..379
x=305, y=265..284
x=495, y=248..259
x=528, y=405..424
y=1000, x=617..636
x=534, y=1701..1714
x=364, y=1193..1203
x=394, y=144..154
x=308, y=1339..1353
y=1091, x=297..300
x=397, y=168..169
y=145, x=427..431
x=522, y=1579..1592
y=1749, x=635..657
x=402, y=1240..1251
x=681, y=747..751
y=203, x=515..535
y=1793, x=307..310
x=332, y=639..652
x=585, y=1185..1191
x=280, y=1062..1088
y=1438, x=548..552
x=483, y=1169..1182
x=518, y=1541..1552
y=289, x=283..285
x=520, y=1214..1220
y=1510, x=291..309
x=451, y=1505..1514
x=309, y=1500..1510
x=301, y=818..827
x=419, y=970..974
x=348, y=59..84
x=455, y=1466..1482
x=575, y=144..164
x=395, y=380..392
x=382, y=825..834
x=420, y=1565..1592
y=365, x=568..574
y=255, x=298..324
x=678, y=747..751
x=321, y=265..284
x=572, y=308..322
x=339, y=1075..1095
y=597, x=515..539
x=384, y=1372..1377
y=990, x=469..477
x=366, y=288..306
x=539, y=153..166
x=618, y=821..836
y=750, x=412..417
x=497, y=470..486
x=484, y=7..21
y=1344, x=319..322
y=823, x=639..646
x=603, y=1401..1403
x=606, y=1203..1210
y=361, x=414..441
x=411, y=78..88
y=746, x=601..618
x=600, y=1426..1432
x=377, y=1398..1406
y=1650, x=480..508
x=452, y=539..541
x=316, y=1785..1797
x=586, y=1070..1093
x=648, y=615..625
x=354, y=259..278
x=528, y=67..80
x=563, y=354..368
y=1372, x=382..384
y=42, x=373..396
x=510, y=264..276
x=540, y=1460..1479
x=359, y=1230..1241
x=346, y=1687..1701
y=787, x=600..620
x=664, y=1226..1242
y=200, x=526..528
x=302, y=974..976
x=454, y=1148..1169
x=341, y=1253..1265
x=358, y=1718..1728
x=664, y=1713..1735
x=529, y=336..338
y=1408, x=591..619
x=504, y=46..57
y=179, x=367..392
x=610, y=657..680
x=337, y=1028..1032
x=656, y=594..604
x=301, y=1301..1317
x=673, y=130..152
x=316, y=995..1016
x=391, y=221..241
x=392, y=1368..1387
x=639, y=932..936
x=365, y=84..93
x=410, y=914..925
x=639, y=797..823
y=1089, x=404..410
x=560, y=1167..1193
y=375, x=656..677
y=815, x=329..348
x=541, y=274..279
x=638, y=1377..1383
x=494, y=308..322
x=310, y=418..426
x=304, y=1741..1751
x=373, y=18..42
x=450, y=1249..1254
x=327, y=1606..1619
x=590, y=164..186
x=518, y=109..120
x=411, y=1051..1055
x=595, y=956..960
x=677, y=1123..1136
x=276, y=757..759
x=338, y=1361..1374
y=45, x=425..453
x=480, y=938..949
y=766, x=564..568
x=293, y=1518..1529
x=402, y=1149..1151
x=554, y=637..660
y=807, x=425..428
x=357, y=1063..1076
x=535, y=1724..1751
x=635, y=131..140
x=563, y=81..90
x=331, y=1363..1368
x=626, y=708..711
y=837, x=532..534
x=330, y=483..489
y=278, x=348..354
y=525, x=570..578
y=660, x=543..554
y=1048, x=284..296
x=388, y=1527..1529
x=417, y=1273..1279
y=1258, x=362..366
y=1409, x=307..310
x=494, y=880..889
y=287, x=651..657
x=554, y=227..238
y=1482, x=435..455
x=600, y=1467..1493
x=283, y=779..806
x=665, y=1550..1552
x=574, y=1475..1478
y=1476, x=307..330
x=598, y=1659..1673
y=1694, x=336..338
y=580, x=413..433
y=952, x=644..652
x=504, y=1170..1182
y=522, x=303..316
y=97, x=680..690
x=477, y=317..319
y=1375, x=444..446
x=514, y=1143..1154
x=375, y=1275..1286
x=671, y=1775..1778
y=907, x=420..424
y=274, x=402..414
y=944, x=404..416
x=667, y=1400..1420
x=572, y=1155..1167
x=305, y=461..467
x=453, y=834..861
x=337, y=318..336
x=539, y=487..493
x=386, y=414..441
x=382, y=76..98
x=551, y=1170..1177
y=259, x=576..578
x=367, y=1558..1566
y=1699, x=278..298
y=985, x=502..507
y=290, x=643..666
y=1817, x=288..299
y=235, x=560..564
y=529, x=595..605
x=325, y=460..467
x=488, y=611..634
x=601, y=667..675
x=366, y=1068..1073
x=355, y=131..139
y=360, x=568..574
y=1300, x=533..561
x=377, y=1151..1160
x=311, y=1539..1549
y=1255, x=318..320
x=551, y=1308..1319
x=555, y=1088..1099
x=574, y=1049..1067
y=1271, x=609..628
x=300, y=377..383
x=288, y=755..764
x=444, y=311..315
x=508, y=46..57
x=420, y=1276..1298
y=1470, x=532..534
x=432, y=554..557
x=628, y=344..360
x=690, y=92..97
x=433, y=1685..1689
x=570, y=252..263
x=676, y=1397..1425
y=1680, x=311..330
y=157, x=524..529
x=664, y=1605..1616
y=1601, x=451..456
x=304, y=64..68
x=687, y=1106..1114
x=547, y=78..102
x=415, y=999..1007
y=378, x=335..349
y=818, x=391..410
x=306, y=1606..1619
x=676, y=593..604
x=436, y=1085..1098
y=184, x=517..533
x=642, y=761..773
x=299, y=964..970
x=594, y=1087..1090
x=655, y=809..824
x=356, y=942..962
x=348, y=808..815
x=644, y=534..544
x=282, y=756..759
y=1045, x=324..345
x=328, y=1538..1549
y=776, x=386..406
y=1592, x=510..522
y=616, x=288..306
x=587, y=1822..1828
x=369, y=84..93
x=342, y=444..454
x=531, y=290..293
y=1434, x=307..312
x=541, y=1485..1502
x=516, y=267..279
x=373, y=1125..1135
x=491, y=283..297
x=483, y=287..294
x=536, y=22..37
y=1185, x=661..663
x=688, y=1284..1301
x=569, y=158..160
y=214, x=686..691
y=520, x=456..458
x=300, y=1498..1507
x=307, y=1791..1793
y=498, x=404..410
x=557, y=897..905
x=663, y=1590..1594
y=401, x=449..470
y=554, x=430..432
x=396, y=644..660
x=276, y=567..581
x=325, y=1442..1452
x=560, y=224..235
x=606, y=50..73
x=463, y=1394..1414
y=1098, x=383..436
x=409, y=54..60
x=647, y=1213..1229
x=690, y=157..177
x=404, y=805..814
x=302, y=1498..1507
x=485, y=471..486
y=1109, x=589..611
y=1696, x=284..287
x=675, y=187..192
y=1401, x=603..610
x=636, y=1543..1560
x=323, y=1087..1100
x=667, y=1550..1552
y=1167, x=572..579
x=560, y=1702..1714
y=1841, x=271..294
x=318, y=1444..1455
y=1191, x=567..585
x=570, y=671..675
x=300, y=1076..1091
x=303, y=1087..1100
y=1353, x=308..330
x=524, y=172..181
x=382, y=1372..1377
y=832, x=655..672
x=320, y=559..584
x=542, y=751..752
x=423, y=609..622
x=646, y=59..73
x=446, y=61..88
y=1027, x=567..595
x=510, y=1580..1592
x=431, y=1697..1721
x=438, y=230..247
x=481, y=925..934
x=444, y=38..40
x=406, y=1433..1454
x=323, y=1194..1200
x=314, y=1092..1095
y=1614, x=342..368
x=377, y=1190..1200
y=102, x=547..556
x=334, y=319..336
x=410, y=1664..1671
x=683, y=1285..1301
y=817, x=671..676
x=492, y=925..936
x=545, y=1578..1583
x=410, y=895..905
y=1525, x=405..430
x=576, y=257..259
y=357, x=635..638
x=524, y=1661..1676
x=371, y=56..58
x=369, y=1636..1659
y=507, x=506..509
y=1300, x=476..502
y=1560, x=636..645
x=645, y=1798..1825
y=1736, x=599..623
y=1073, x=403..405
y=1478, x=567..574
x=518, y=488..493
x=584, y=1207..1221
x=462, y=1350..1357
y=1529, x=386..388
x=373, y=1369..1387
y=1413, x=307..310
x=456, y=1601..1613
y=256, x=504..506
y=490, x=377..401
y=1837, x=285..288
y=541, x=452..514
x=419, y=575..577
x=500, y=1610..1613
x=517, y=1648..1658
x=278, y=1667..1680
x=544, y=227..241
y=427, x=566..570
x=304, y=117..139
y=1121, x=292..300
x=525, y=127..146
x=522, y=1724..1751
x=658, y=1325..1350
y=1675, x=286..290
y=1260, x=289..310
y=1030, x=633..657
y=424, x=528..539
x=301, y=408..414
y=334, x=672..678
x=652, y=1329..1332
y=140, x=542..544
x=684, y=1125..1150
x=595, y=818..844
x=493, y=5..16
x=612, y=636..645
x=489, y=1069..1075
x=386, y=765..776
y=329, x=359..368
y=675, x=598..601
x=524, y=1063..1069
y=961, x=499..507
x=449, y=1638..1649
x=545, y=750..752
x=347, y=527..543
x=585, y=832..841
y=694, x=544..551
x=512, y=1228..1255
y=806, x=283..288
y=1317, x=301..318
x=484, y=228..243
x=377, y=1590..1593
y=486, x=485..497
x=674, y=786..799
y=1287, x=650..675
y=280, x=360..381
x=300, y=1406..1416
x=607, y=372..396
y=1295, x=483..488
x=537, y=1307..1319
y=276, x=433..451
y=1241, x=356..359
x=552, y=1431..1438
y=974, x=415..419
y=1151, x=402..418
x=333, y=838..850
x=402, y=1397..1406
x=356, y=1150..1160
x=422, y=379..392
x=493, y=30..41
y=1791, x=307..310
y=1493, x=586..600
x=509, y=989..1014
x=300, y=77..99
y=1437, x=299..318
y=459, x=599..609
x=430, y=959..979
y=661, x=667..669
x=677, y=889..900
x=469, y=473..485
y=472, x=675..683
y=1478, x=347..364
x=300, y=1516..1524
x=410, y=807..818
y=1095, x=312..314
x=427, y=833..861
x=312, y=1711..1721
x=382, y=1297..1311
y=960, x=595..622
y=1116, x=370..390
x=472, y=1442..1443
x=531, y=208..219
x=611, y=50..73
y=40, x=437..444
x=582, y=1446..1452
x=403, y=145..154
x=407, y=385..387
x=644, y=413..415
x=406, y=413..441
x=383, y=1760..1765
x=314, y=838..850
x=633, y=1359..1383
y=574, x=347..350
x=311, y=1366..1369
x=515, y=108..120
x=300, y=64..68
x=289, y=335..346
x=515, y=193..203
y=1059, x=483..499
x=591, y=1398..1408
x=413, y=131..133
y=414, x=301..312
x=506, y=504..507
x=488, y=1696..1705
y=1507, x=300..302
x=678, y=1107..1114
x=356, y=700..708
x=411, y=1440..1449
x=330, y=1339..1353
x=631, y=656..669
x=496, y=90..101
x=285, y=181..185
y=1549, x=379..395
y=1689, x=433..452
x=675, y=1285..1287
y=617, x=335..341
y=759, x=584..607
x=492, y=1002..1026
y=1642, x=490..495
x=531, y=131..145
y=1524, x=300..304
x=655, y=94..97
x=473, y=1735..1739
x=521, y=1051..1058
y=518, x=456..458
x=596, y=1087..1090
x=396, y=805..814
x=518, y=71..73
x=389, y=344..361
y=652, x=320..332
y=1397, x=310..348
y=1416, x=300..316
y=233, x=353..365
y=1502, x=409..422
y=759, x=276..282
x=644, y=601..611
x=570, y=416..427
y=1590, x=472..486
y=1699, x=676..678
y=872, x=317..319
x=342, y=1590..1614
y=1592, x=420..441
y=651, x=494..521
y=1520, x=616..621
y=1425, x=658..676
x=271, y=1829..1841
x=359, y=326..329
y=1351, x=497..514
x=347, y=572..574
x=333, y=1297..1311
y=1368, x=325..331
x=466, y=1630..1639
x=568, y=360..365
x=285, y=1832..1837
y=1210, x=606..608
x=665, y=615..625
y=664, x=654..675
y=462, x=469..620
x=575, y=1234..1236
x=448, y=1476..1479
x=394, y=1677..1686
x=507, y=968..985
x=676, y=95..97
x=296, y=1647..1659
y=1320, x=625..633
y=1807, x=434..458
y=60, x=409..417
x=468, y=1395..1414
x=454, y=611..623
y=1448, x=646..651
x=449, y=382..401
y=991, x=628..630
y=247, x=427..438
x=429, y=1275..1298
y=441, x=386..406
x=425, y=1355..1360
x=416, y=942..944
x=509, y=1812..1835
y=161, x=358..376
y=440, x=409..431
x=658, y=495..510
y=1332, x=648..652
x=323, y=394..408
x=464, y=1194..1213
x=324, y=284..307
y=1255, x=512..525
x=293, y=605..609
y=302, x=592..595
y=1778, x=308..361
y=1113, x=380..383
x=667, y=1776..1778
y=68, x=300..304
y=80, x=510..528
x=682, y=810..824
x=645, y=1543..1560
y=1136, x=650..677
x=433, y=534..544
x=542, y=129..140
y=160, x=567..569
y=936, x=623..639
x=663, y=1400..1420
x=350, y=948..958
x=579, y=1154..1167
x=373, y=295..302
x=470, y=283..297
y=905, x=557..560
x=483, y=143..165
x=632, y=742..755
y=976, x=609..628
y=346, x=284..289
x=624, y=1443..1445
y=1160, x=356..377
y=905, x=393..410
x=524, y=1460..1479
x=676, y=853..871
x=489, y=1441..1443
x=663, y=139..142
x=582, y=1470..1485
x=517, y=889..892
x=421, y=783..792
x=394, y=1275..1286
x=551, y=673..694
y=927, x=639..661
y=1424, x=410..420
x=374, y=1047..1055
y=311, x=585..588
x=688, y=1066..1068
y=1139, x=368..386
x=412, y=747..750
y=489, x=317..330
x=284, y=1272..1289
x=515, y=31..41
x=483, y=1043..1059
y=1813, x=548..562
x=314, y=702..710
x=274, y=1191..1206
y=292, x=616..625
y=134, x=596..598
x=610, y=424..444
y=126, x=504..512
x=391, y=1620..1621
x=671, y=1682..1687
x=535, y=329..355
x=444, y=1592..1617
x=542, y=1239..1247
x=663, y=1165..1185
x=404, y=942..944
y=1007, x=415..418
x=584, y=752..759
x=643, y=1515..1527
y=970, x=415..419
x=579, y=1760..1770
y=101, x=496..539
y=411, x=563..585
x=304, y=1516..1524
x=623, y=933..936
x=691, y=210..214
x=373, y=1212..1224
x=382, y=591..619
y=949, x=475..480
x=526, y=336..338
y=976, x=302..327
y=729, x=366..377
x=335, y=607..617
x=542, y=1634..1642
y=1149, x=550..559
x=581, y=1339..1364
x=454, y=1550..1574
x=604, y=890..900
y=69, x=381..388
x=288, y=1812..1817
y=1636, x=325..327
x=644, y=938..952
x=469, y=963..990
x=325, y=845..847
x=431, y=435..440
x=668, y=1461..1488
y=139, x=296..304
y=73, x=642..646
x=490, y=314..331
x=442, y=1261..1273
y=1557, x=553..572
y=688, x=375..377
y=845, x=319..325
x=381, y=59..69
y=338, x=526..529
x=635, y=353..357
x=475, y=939..949
x=296, y=116..139
y=210, x=357..380
x=275, y=797..801
x=633, y=815..834
y=1286, x=375..394
x=351, y=323..332
x=477, y=1696..1705
x=392, y=173..179
x=633, y=472..481
x=335, y=1445..1455
x=470, y=927..931
x=584, y=1625..1631
x=458, y=1781..1807
y=307, x=324..334
x=296, y=1021..1048
y=219, x=531..554
x=369, y=1532..1549
x=599, y=1151..1157
x=410, y=1089..1092
y=1051, x=309..321
y=692, x=358..385
x=381, y=270..280
x=651, y=889..900
x=616, y=1660..1673
y=444, x=610..620
x=628, y=965..976
x=458, y=974..996
y=1835, x=642..667
x=594, y=1509..1526
y=1527, x=633..638
y=1374, x=320..338
x=366, y=482..500
x=445, y=515..526
x=510, y=1544..1546
x=445, y=142..157
y=1783, x=379..407
y=1549, x=369..374
x=560, y=286..297
x=539, y=91..101
x=539, y=404..424
x=631, y=814..834
y=166, x=519..539
x=526, y=172..181
y=952, x=277..299
x=550, y=132..145
y=600, x=423..443
y=1055, x=374..379
y=993, x=628..630
x=512, y=1764..1784
y=1350, x=640..658
x=640, y=1589..1594
x=275, y=642..667
x=633, y=1517..1527
x=659, y=1377..1383
x=409, y=1022..1036
y=287, x=483..485
x=441, y=1175..1179
x=271, y=643..667
x=629, y=1497..1525
x=316, y=1558..1567
x=327, y=1561..1570
x=632, y=550..559
y=1696, x=585..598
y=1036, x=392..409
x=372, y=483..500
y=1443, x=624..628
x=615, y=931..935
x=317, y=1363..1375
x=579, y=163..186
x=641, y=228..247
x=423, y=587..600
y=1525, x=603..629
x=290, y=1665..1675
y=331, x=470..490
x=320, y=352..360
y=1220, x=492..520
x=595, y=506..529
x=568, y=763..766
y=1221, x=569..584
y=988, x=674..690
y=768, x=439..459
x=391, y=808..818
y=1638, x=291..301
x=398, y=763..773
y=93, x=365..369
y=293, x=531..537
x=598, y=1680..1696
y=292, x=414..416
x=403, y=828..841
x=319, y=1664..1674
y=1114, x=678..687
x=630, y=1782..1785
x=278, y=1361..1368
x=377, y=682..688
y=799, x=664..674
x=611, y=1106..1109
x=657, y=1744..1749
x=515, y=71..73
y=25, x=461..475
x=386, y=916..924
x=685, y=683..694
x=373, y=1190..1200
x=401, y=288..303
x=615, y=1235..1250
y=1245, x=351..367
y=396, x=602..607
x=508, y=1624..1650
x=428, y=1582..1587
y=1058, x=521..534
y=1224, x=353..373
x=312, y=1727..1736
x=422, y=288..303
x=356, y=1230..1241
x=359, y=1217..1221
x=373, y=828..837
y=917, x=538..542
y=1440, x=411..415
x=674, y=158..177
y=210, x=406..424
x=616, y=574..602
x=385, y=676..692
x=319, y=1582..1595
x=387, y=596..600
y=152, x=654..673
x=311, y=1519..1529
y=889, x=494..504
x=480, y=1625..1650
y=834, x=382..384
x=427, y=1638..1649
x=623, y=1725..1736
y=854, x=382..385
x=502, y=1286..1300
x=301, y=1619..1638
y=1785, x=624..630
y=88, x=446..453
x=501, y=8..21
x=661, y=1165..1185
x=310, y=1386..1397
x=670, y=186..192
y=713, x=607..609
x=374, y=1533..1549
x=585, y=1679..1696
y=98, x=360..382
x=514, y=1340..1351
x=366, y=1258..1262
y=38, x=437..444
x=585, y=397..411
x=616, y=320..327
y=1254, x=450..469
y=772, x=478..487
y=1170, x=551..554
y=882, x=686..690
y=903, x=619..643
y=832, x=585..587
x=640, y=1775..1776
x=316, y=514..522
x=587, y=832..841
x=609, y=710..713
x=656, y=872..886
y=619, x=356..382
x=656, y=570..582
y=1377, x=382..384
x=404, y=1530..1536
x=385, y=1637..1659
x=283, y=285..289
y=276, x=506..510
y=883, x=627..632
x=651, y=282..287
y=994, x=388..409
x=605, y=302..305
x=398, y=122..136
x=543, y=636..660
x=443, y=551..561
x=544, y=129..140
x=600, y=1508..1526
y=566, x=312..314
x=514, y=539..541
x=368, y=1127..1139
x=451, y=253..276
x=320, y=1248..1255
x=496, y=266..279
x=527, y=1635..1642
x=635, y=1405..1419
x=275, y=1362..1368
x=386, y=1788..1793
x=676, y=1687..1699
y=41, x=493..515
y=627, x=475..482
x=317, y=869..872
x=499, y=1044..1059
x=560, y=897..905
x=378, y=51..65
x=348, y=948..958
y=1621, x=391..411
x=437, y=38..40
x=374, y=645..660
y=140, x=627..635
y=904, x=295..300
x=309, y=821..823
x=329, y=1239..1246
y=292, x=276..292
y=1283, x=381..384
y=841, x=395..403
x=608, y=1203..1210
x=324, y=252..255
x=379, y=1525..1549
x=526, y=191..200
y=820, x=671..676
x=667, y=1832..1835
x=310, y=1791..1793
x=609, y=1269..1271
x=532, y=990..1014
x=388, y=874..878
x=427, y=123..145
x=626, y=553..562
y=680, x=593..610
x=425, y=21..45
x=597, y=1447..1452
y=160, x=524..529
x=505, y=670..683
y=1162, x=541..565
y=96, x=479..481
x=420, y=886..907
x=547, y=1034..1044
x=456, y=518..520
y=688, x=306..313
x=652, y=937..952
x=336, y=1694..1698
y=582, x=635..656
x=331, y=431..437
x=657, y=1606..1616
y=311, x=274..282
x=480, y=1462..1483
x=422, y=1493..1502
x=386, y=1527..1529
x=412, y=1037..1043
y=1567, x=316..319
x=384, y=1278..1283
y=19, x=522..524
x=574, y=758..770
x=310, y=53..72
y=169, x=380..397
x=452, y=474..485
x=329, y=807..815
x=532, y=1485..1502
y=861, x=427..453
x=620, y=773..787
y=1183, x=366..390
y=58, x=369..371
y=1714, x=534..560
y=714, x=414..422
x=512, y=114..126
y=871, x=665..676
x=351, y=1082..1105
x=508, y=743..766
x=345, y=1818..1826
y=241, x=391..418
x=664, y=786..799
x=506, y=264..276
x=638, y=550..559
x=361, y=1764..1778
y=1633, x=673..677
y=41, x=617..642
y=1250, x=606..615
x=274, y=305..311
x=574, y=82..90
y=1436, x=526..540
y=1473, x=532..534
x=310, y=755..764
x=590, y=930..935
y=1493, x=288..307
x=332, y=1710..1721
x=515, y=1649..1658
x=566, y=416..427
y=1739, x=449..473
x=492, y=671..683
y=73, x=606..611
x=507, y=947..961
x=417, y=55..60
y=1067, x=551..574
x=690, y=862..882
y=1509, x=616..621
x=589, y=320..327
x=654, y=1652..1672
y=1217, x=359..365
x=619, y=1151..1157
x=314, y=76..99
x=405, y=610..622
x=536, y=1368..1371
y=1077, x=395..414
x=433, y=252..276
x=463, y=1461..1483
y=733, x=416..693
x=386, y=1128..1139
x=479, y=495..505
x=341, y=608..617
y=1676, x=524..539
x=433, y=570..580
x=528, y=127..146
x=615, y=1774..1776
y=1360, x=423..425
x=683, y=1625..1645
x=453, y=60..88
x=564, y=224..235
x=344, y=209..213
x=343, y=432..437
x=653, y=1404..1419
x=292, y=1105..1121
y=1098, x=488..516
y=1633, x=490..495
y=290, x=531..537
x=444, y=1373..1375
x=358, y=566..577
x=612, y=575..602
x=420, y=1410..1424
y=1835, x=509..521
x=400, y=1020..1033
x=625, y=287..292
x=595, y=1001..1027
x=410, y=482..498
y=609, x=293..295
x=680, y=1124..1150
x=353, y=222..233
x=561, y=1290..1300
x=406, y=742..754
x=586, y=12..21
x=633, y=1010..1030
y=1475, x=567..574
x=471, y=107..119
y=408, x=323..326
x=566, y=101..110
y=306, x=366..388
y=1680, x=278..296
y=146, x=525..528
x=441, y=1566..1592
y=1659, x=296..328
x=607, y=435..445
x=317, y=817..827
x=598, y=667..675
x=665, y=853..871
y=773, x=398..400
x=291, y=1620..1638
y=827, x=301..317
x=318, y=1301..1317
x=415, y=1051..1055
x=690, y=972..988
x=483, y=123..136
y=562, x=626..646
x=591, y=973..991
x=635, y=1250..1263
y=1752, x=476..492
x=434, y=974..996
y=27, x=509..511
y=1587, x=428..434
x=479, y=317..319
x=605, y=507..529
x=619, y=1605..1627
x=390, y=1241..1251
x=277, y=947..952
y=297, x=470..491
x=299, y=1362..1375
x=528, y=191..200
x=284, y=1021..1048
x=539, y=1660..1676
x=588, y=302..311
x=473, y=1321..1341
x=638, y=353..357
y=295, x=604..632
x=675, y=652..664
x=580, y=598..615
y=1060, x=397..422
y=100, x=472..487
x=672, y=320..334
x=538, y=1294..1296
y=387, x=407..415
y=934, x=453..481
x=377, y=481..490
x=693, y=719..733
x=659, y=26..33
x=532, y=828..837
x=335, y=130..139
y=119, x=440..445
y=1022, x=667..686
y=204, x=678..688
y=921, x=418..420
x=402, y=269..274
x=467, y=612..634
x=463, y=1506..1514
x=562, y=1804..1813
x=633, y=157..164
x=369, y=56..58
x=595, y=295..302
y=1105, x=351..366
x=366, y=1082..1105
y=146, x=585..589
x=482, y=627..629
y=1154, x=514..517
y=1099, x=547..555
x=395, y=827..841
x=419, y=1209..1225
x=508, y=1544..1546
y=1724, x=368..373
y=1432, x=583..600
x=470, y=315..331
y=165, x=682..684
y=1193, x=545..560
x=582, y=620..643
y=13, x=522..524
y=1736, x=289..312
y=360, x=301..320
y=1797, x=297..316
x=628, y=1268..1271
x=650, y=1286..1287
x=309, y=1027..1051
x=401, y=892..902
x=612, y=1604..1627
x=423, y=1251..1256
x=633, y=188..208
y=814, x=396..404
x=368, y=988..1005
y=305, x=605..607
x=498, y=48..60
y=1100, x=303..323
y=1613, x=500..508
y=164, x=554..575
y=1092, x=404..410
x=415, y=787..799
x=295, y=880..904
x=678, y=1686..1699
x=378, y=1557..1566
x=327, y=973..976
x=271, y=566..581
y=1527, x=643..650
x=609, y=1625..1631
y=1420, x=663..667
y=1698, x=336..338
y=1246, x=325..329
x=397, y=1046..1060
x=387, y=955..968
y=944, x=666..669
y=131, x=403..413
x=562, y=12..21
x=400, y=1351..1356
x=443, y=587..600
x=509, y=504..507
x=300, y=1481..1490
x=628, y=1443..1445

A descriptions/Day17.md => descriptions/Day17.md +205 -0
@@ 0,0 1,205 @@
\-\-- Day 17: Reservoir Research \-\--
--------------------------------------

You arrive in the year 18. If it weren\'t for [the
coat]{title="Continuity!"} you got in 1018, you would be very cold: the
North Pole base hasn\'t even been constructed.

Rather, it hasn\'t been constructed *yet*. The Elves are making a little
progress, but there\'s not a lot of liquid water in this climate, so
they\'re getting very dehydrated. Maybe there\'s more underground?

You scan a two-dimensional vertical slice of the ground nearby and
discover that it is mostly *sand* with veins of *clay*. The scan only
provides data with a granularity of *square meters*, but it should be
good enough to determine how much water is trapped there. In the scan,
`x` represents the distance to the right, and `y` represents the
distance down. There is also a *spring of water* near the surface at
`x=500, y=0`. The scan identifies *which square meters are clay* (your
puzzle input).

For example, suppose your scan shows the following veins of clay:

    x=495, y=2..7
    y=7, x=495..501
    x=501, y=3..7
    x=498, y=2..4
    x=506, y=1..2
    x=498, y=10..13
    x=504, y=10..13
    y=13, x=498..504

Rendering clay as `#`, sand as `.`, and the water spring as `+`, and
with `x` increasing to the right and `y` increasing downward, this
becomes:

       44444455555555
       99999900000000
       45678901234567
     0 ......+.......
     1 ............#.
     2 .#..#.......#.
     3 .#..#..#......
     4 .#..#..#......
     5 .#.....#......
     6 .#.....#......
     7 .#######......
     8 ..............
     9 ..............
    10 ....#.....#...
    11 ....#.....#...
    12 ....#.....#...
    13 ....#######...

The spring of water will produce water *forever*. Water can move through
sand, but is blocked by clay. Water *always moves down* when possible,
and spreads to the left and right otherwise, filling space that has clay
on both sides and falling out otherwise.

For example, if five squares of water are created, they will flow
downward until they reach the clay and settle there. Water that has come
to rest is shown here as `~`, while sand through which water has passed
(but which is now dry again) is shown as `|`:

    ......+.......
    ......|.....#.
    .#..#.|.....#.
    .#..#.|#......
    .#..#.|#......
    .#....|#......
    .#~~~~~#......
    .#######......
    ..............
    ..............
    ....#.....#...
    ....#.....#...
    ....#.....#...
    ....#######...

Two squares of water can\'t occupy the same location. If another five
squares of water are created, they will settle on the first five,
filling the clay reservoir a little more:

    ......+.......
    ......|.....#.
    .#..#.|.....#.
    .#..#.|#......
    .#..#.|#......
    .#~~~~~#......
    .#~~~~~#......
    .#######......
    ..............
    ..............
    ....#.....#...
    ....#.....#...
    ....#.....#...
    ....#######...

Water pressure does not apply in this scenario. If another four squares
of water are created, they will stay on the right side of the barrier,
and no water will reach the left side:

    ......+.......
    ......|.....#.
    .#..#.|.....#.
    .#..#~~#......
    .#..#~~#......
    .#~~~~~#......
    .#~~~~~#......
    .#######......
    ..............
    ..............
    ....#.....#...
    ....#.....#...
    ....#.....#...
    ....#######...

At this point, the top reservoir overflows. While water can reach the
tiles above the surface of the water, it cannot settle there, and so the
next five squares of water settle like this:

    ......+.......
    ......|.....#.
    .#..#||||...#.
    .#..#~~#|.....
    .#..#~~#|.....
    .#~~~~~#|.....
    .#~~~~~#|.....
    .#######|.....
    ........|.....
    ........|.....
    ....#...|.#...
    ....#...|.#...
    ....#~~~~~#...
    ....#######...

Note especially the leftmost `|`: the new squares of water can reach
this tile, but cannot stop there. Instead, eventually, they all fall to
the right and settle in the reservoir below.

After 10 more squares of water, the bottom reservoir is also full:

    ......+.......
    ......|.....#.
    .#..#||||...#.
    .#..#~~#|.....
    .#..#~~#|.....
    .#~~~~~#|.....
    .#~~~~~#|.....
    .#######|.....
    ........|.....
    ........|.....
    ....#~~~~~#...
    ....#~~~~~#...
    ....#~~~~~#...
    ....#######...

Finally, while there is nowhere left for the water to settle, it can
reach a few more tiles before overflowing beyond the bottom of the
scanned data:

    ......+.......    (line not counted: above minimum y value)
    ......|.....#.
    .#..#||||...#.
    .#..#~~#|.....
    .#..#~~#|.....
    .#~~~~~#|.....
    .#~~~~~#|.....
    .#######|.....
    ........|.....
    ...|||||||||..
    ...|#~~~~~#|..
    ...|#~~~~~#|..
    ...|#~~~~~#|..
    ...|#######|..
    ...|.......|..    (line not counted: below maximum y value)
    ...|.......|..    (line not counted: below maximum y value)
    ...|.......|..    (line not counted: below maximum y value)

How many tiles can be reached by the water? *To prevent counting
forever*, ignore tiles with a `y` coordinate smaller than the smallest
`y` coordinate in your scan data or larger than the largest one. Any `x`
coordinate is valid. In this example, the lowest `y` coordinate given is
`1`, and the highest is `13`, causing the water spring (in row `0`) and
the water falling off the bottom of the render (in rows `14` through
infinity) to be ignored.

So, in the example above, counting both water at rest (`~`) and other
sand tiles the water can hypothetically reach (`|`), the total number of
tiles the water can reach is `57`.

*How many tiles can the water reach* within the range of `y` values in
your scan?

\-\-- Part Two \-\-- {#part2}
--------------------

After [a very long
time]{title="A very long time ago, I built something similar to this in QBasic. SCREEN 13 forever!"},
the water spring will run dry. How much water will be retained?

In the example above, water that won\'t eventually drain out is shown as
`~`, a total of `29` tiles.

*How many water tiles are left* after the water spring stops producing
water and all remaining water not at rest has drained?

M src/bin/day17.rs => src/bin/day17.rs +112 -1
@@ 1,1 1,112 @@
fn main() {}
use std::ops::RangeInclusive;

use lazy_static::lazy_static;
use regex::Regex;
use rustc_hash::FxHashSet;

static INPUT: &str = "data/day17";

struct ClayRange {
    is_vert: bool,
    pos: i64,
    range: RangeInclusive<i64>,
}

impl std::str::FromStr for ClayRange {
    type Err = &'static str;
    fn from_str(s: &str) -> Result<Self, &'static str> {
        lazy_static! {
            static ref PARSE: Regex = Regex::new(r"^(x|y)=(\d+), (x|y)=(\d+)\.\.(\d+)$").unwrap();
        }
        let caps = PARSE.captures(s).expect("string did not match");
        let is_vert = if caps.get(1).unwrap().as_str() == "x" {
            true
        } else {
            false
        };
        let pos = caps.get(2).unwrap().as_str().parse().unwrap();
        let range = RangeInclusive::new(
            caps.get(4).unwrap().as_str().parse().unwrap(),
            caps.get(5).unwrap().as_str().parse().unwrap(),
        );
        Ok(Self {
            is_vert,
            pos,
            range,
        })
    }
}

type Pt = (i64, i64);

fn fill(
    flow: &mut FxHashSet<Pt>,
    set: &mut FxHashSet<Pt>,
    clay: &FxHashSet<Pt>,
    max_y: i64,
    x: i64,
    y: i64,
    dir: i8,
) -> bool {
    flow.insert((x, y));

    let bel = (x, y + 1);
    if !clay.contains(&bel) && !flow.contains(&bel) && bel.1 >= 1 && bel.1 <= max_y {
        fill(flow, set, clay, max_y, x, y + 1, 0);
    }

    if !clay.contains(&bel) && !set.contains(&bel) {
        return false;
    }

    let mut lft = (x - 1, y);
    let mut rgt = (x + 1, y);

    let lfill = clay.contains(&lft)
        || !flow.contains(&lft) && fill(flow, set, clay, max_y, lft.0, lft.1, -1);
    let rfill = clay.contains(&rgt)
        || !flow.contains(&rgt) && fill(flow, set, clay, max_y, rgt.0, rgt.1, 1);

    if dir == 0 && lfill && rfill {
        set.insert((x, y));

        while flow.contains(&lft) {
            set.insert(lft);
            lft.0 -= 1;
        }

        while flow.contains(&rgt) {
            set.insert(rgt);
            rgt.0 += 1;
        }
    }

    dir == -1 && (lfill || clay.contains(&lft))
        || dir == 1 && (rfill || clay.contains(&rgt))
}

fn main() {
    let input: Vec<ClayRange> = aoc::file::to_single_parsed(INPUT);
    let mut clay = FxHashSet::default();
    for ClayRange {
        is_vert,
        pos,
        range,
    } in input
    {
        for i in range {
            if is_vert {
                clay.insert((pos, i));
            } else {
                clay.insert((i, pos));
            }
        }
    }
    let max_y = clay.iter().max_by_key(|(_, y)| y).expect("empty set").1;
    let min_y = clay.iter().min_by_key(|(_, y)| y).expect("empty set").1;
    let mut flow = FxHashSet::default();
    let mut set = FxHashSet::default();
    fill(&mut flow, &mut set, &clay, max_y, 500, 0, 0);
    println!("  1: {}", flow.iter().filter(|p| p.1 >= min_y && p.1 <= max_y).count());
    println!("  2: {}", set.iter().filter(|p| p.1 >= min_y && p.1 <= max_y).count());
}