From 5f6a8fe251a3916931805d1839266f090d707127 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 19 Dec 2017 07:58:36 +1100 Subject: [PATCH] Add day 12 solution --- 2017/day/12/Cargo.lock | 4 + 2017/day/12/Cargo.toml | 6 + 2017/day/12/input | 2000 +++++++++++++++++++++++++++++++++++++++ 2017/day/12/problem.txt | 34 + 2017/day/12/src/main.rs | 43 + 5 files changed, 2087 insertions(+) create mode 100644 2017/day/12/Cargo.lock create mode 100644 2017/day/12/Cargo.toml create mode 100644 2017/day/12/input create mode 100644 2017/day/12/problem.txt create mode 100644 2017/day/12/src/main.rs diff --git a/2017/day/12/Cargo.lock b/2017/day/12/Cargo.lock new file mode 100644 index 0000000..411c289 --- /dev/null +++ b/2017/day/12/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "day12" +version = "0.1.0" + diff --git a/2017/day/12/Cargo.toml b/2017/day/12/Cargo.toml new file mode 100644 index 0000000..d5b2d5a --- /dev/null +++ b/2017/day/12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "day12" +version = "0.1.0" +authors = ["Wesley Moore "] + +[dependencies] diff --git a/2017/day/12/input b/2017/day/12/input new file mode 100644 index 0000000..569ab65 --- /dev/null +++ b/2017/day/12/input @@ -0,0 +1,2000 @@ +0 <-> 1543 +1 <-> 66, 1682 +2 <-> 1525 +3 <-> 958 +4 <-> 593, 1542 +5 <-> 484 +6 <-> 297 +7 <-> 372, 743, 1965 +8 <-> 934 +9 <-> 1224, 1489 +10 <-> 10, 129, 147, 1394 +11 <-> 1244 +12 <-> 12, 994, 1954 +13 <-> 1027 +14 <-> 875, 1211 +15 <-> 405 +16 <-> 1437, 1476 +17 <-> 996 +18 <-> 216, 777 +19 <-> 404, 1524, 1539, 1941 +20 <-> 1365 +21 <-> 21, 460, 1431, 1624 +22 <-> 313, 530 +23 <-> 942, 1125 +24 <-> 180, 338 +25 <-> 771, 1547, 1561 +26 <-> 463, 1012, 1276, 1760 +27 <-> 738 +28 <-> 311, 1023, 1461, 1739, 1853, 1900 +29 <-> 1075 +30 <-> 355, 467, 1605 +31 <-> 1137, 1740 +32 <-> 1125, 1756 +33 <-> 658, 1149, 1790 +34 <-> 344, 899 +35 <-> 337, 716, 1416, 1780 +36 <-> 1641 +37 <-> 812 +38 <-> 86, 1195 +39 <-> 1967 +40 <-> 1125, 1550 +41 <-> 1881 +42 <-> 151 +43 <-> 222 +44 <-> 73, 1075 +45 <-> 1865 +46 <-> 634, 837, 1143 +47 <-> 647 +48 <-> 695, 901 +49 <-> 49 +50 <-> 1598, 1619 +51 <-> 125, 550, 1161 +52 <-> 241, 387, 1951 +53 <-> 286, 1414 +54 <-> 1231, 1926 +55 <-> 437, 1292, 1919 +56 <-> 1108, 1597 +57 <-> 1073, 1205, 1565 +58 <-> 555 +59 <-> 59, 1410 +60 <-> 1735 +61 <-> 61 +62 <-> 149, 525, 1341 +63 <-> 356, 1251 +64 <-> 146, 1187 +65 <-> 1582 +66 <-> 1 +67 <-> 126, 303, 1942 +68 <-> 1135, 1742 +69 <-> 1904 +70 <-> 70, 371 +71 <-> 513 +72 <-> 1877 +73 <-> 44 +74 <-> 1617 +75 <-> 1495 +76 <-> 326, 867 +77 <-> 420, 961, 1425 +78 <-> 1517 +79 <-> 1233 +80 <-> 415, 1075, 1354 +81 <-> 958, 1089 +82 <-> 1677 +83 <-> 403 +84 <-> 85, 1877 +85 <-> 84, 260 +86 <-> 38, 191, 442 +87 <-> 969, 1993 +88 <-> 610, 1507 +89 <-> 151, 758, 1081, 1521, 1596 +90 <-> 474, 1958 +91 <-> 950, 1554, 1949 +92 <-> 117, 169 +93 <-> 1899 +94 <-> 819 +95 <-> 1886 +96 <-> 360, 1626 +97 <-> 916, 1146 +98 <-> 675, 1502, 1566 +99 <-> 384 +100 <-> 1905 +101 <-> 403, 1387, 1717 +102 <-> 196, 1281 +103 <-> 947 +104 <-> 104 +105 <-> 975 +106 <-> 303, 546, 750 +107 <-> 380, 1929 +108 <-> 108 +109 <-> 999, 1059 +110 <-> 1617 +111 <-> 340 +112 <-> 112 +113 <-> 1063, 1281, 1758 +114 <-> 114 +115 <-> 631, 1067, 1904 +116 <-> 1036 +117 <-> 92, 318 +118 <-> 1269 +119 <-> 898 +120 <-> 1052 +121 <-> 121 +122 <-> 1046 +123 <-> 1127 +124 <-> 717, 1018 +125 <-> 51, 535, 639, 709 +126 <-> 67, 557, 1060, 1098, 1640 +127 <-> 1286 +128 <-> 128 +129 <-> 10, 1467 +130 <-> 492, 1961 +131 <-> 1103, 1433 +132 <-> 1191 +133 <-> 309, 1049 +134 <-> 1361, 1390 +135 <-> 683, 1575 +136 <-> 702, 1188 +137 <-> 290, 302, 1527 +138 <-> 656, 975, 1279 +139 <-> 882, 1537, 1542, 1930 +140 <-> 1200 +141 <-> 562, 680, 1865 +142 <-> 1233 +143 <-> 653, 1076 +144 <-> 1334 +145 <-> 145, 1797 +146 <-> 64 +147 <-> 10, 863, 1090 +148 <-> 1138 +149 <-> 62, 463 +150 <-> 1223, 1228, 1239 +151 <-> 42, 89, 404, 694 +152 <-> 1389, 1672 +153 <-> 1596 +154 <-> 1193 +155 <-> 980 +156 <-> 164 +157 <-> 157, 1270 +158 <-> 272, 1461 +159 <-> 777, 1153 +160 <-> 595, 1209 +161 <-> 365, 686 +162 <-> 516, 987 +163 <-> 546, 1004, 1056 +164 <-> 156, 164 +165 <-> 165, 1696 +166 <-> 310, 370, 397 +167 <-> 1446 +168 <-> 1900 +169 <-> 92, 1680 +170 <-> 240, 619, 1088, 1509 +171 <-> 186, 1610 +172 <-> 1622, 1698 +173 <-> 447, 542, 912 +174 <-> 669, 1687 +175 <-> 689 +176 <-> 176, 1816 +177 <-> 518, 1422, 1493 +178 <-> 479, 731, 1615, 1718 +179 <-> 483 +180 <-> 24, 180 +181 <-> 329, 1941 +182 <-> 405, 1175, 1685 +183 <-> 291, 466, 558, 891 +184 <-> 527 +185 <-> 185, 868, 1136 +186 <-> 171, 867 +187 <-> 1622, 1634 +188 <-> 211 +189 <-> 797 +190 <-> 1307, 1504 +191 <-> 86, 996 +192 <-> 1810 +193 <-> 315 +194 <-> 194, 1198 +195 <-> 1401, 1581, 1904 +196 <-> 102 +197 <-> 539 +198 <-> 1996 +199 <-> 1601 +200 <-> 1617, 1776 +201 <-> 294, 390 +202 <-> 839, 986 +203 <-> 1683 +204 <-> 546 +205 <-> 1673, 1894 +206 <-> 1825 +207 <-> 207, 222 +208 <-> 210, 1679 +209 <-> 384, 421, 1249 +210 <-> 208, 210, 1721 +211 <-> 188, 211, 388, 394, 440, 1205 +212 <-> 834, 1857 +213 <-> 1102 +214 <-> 1803 +215 <-> 1033, 1831 +216 <-> 18, 1039 +217 <-> 1168, 1983 +218 <-> 1273, 1944 +219 <-> 845, 1271 +220 <-> 321, 640 +221 <-> 629 +222 <-> 43, 207, 285, 1486, 1508 +223 <-> 809, 1371 +224 <-> 480 +225 <-> 904, 1190, 1378 +226 <-> 226 +227 <-> 1044, 1294 +228 <-> 793, 911 +229 <-> 1450, 1940 +230 <-> 822 +231 <-> 321, 352 +232 <-> 232 +233 <-> 491, 543 +234 <-> 1880 +235 <-> 861, 1349 +236 <-> 1738, 1977 +237 <-> 590, 1246, 1805 +238 <-> 238, 665 +239 <-> 577, 818, 877 +240 <-> 170 +241 <-> 52, 241, 946, 1439, 1441 +242 <-> 262, 1226, 1647, 1661 +243 <-> 316, 1117, 1831 +244 <-> 345 +245 <-> 527, 1392, 1526 +246 <-> 1335 +247 <-> 1754, 1842, 1905 +248 <-> 1572 +249 <-> 1066, 1185, 1593 +250 <-> 934, 1775, 1821 +251 <-> 726, 749 +252 <-> 252 +253 <-> 253 +254 <-> 1765 +255 <-> 753, 1337 +256 <-> 411, 1190 +257 <-> 1664, 1731 +258 <-> 846 +259 <-> 450, 1062, 1975 +260 <-> 85, 1097, 1620 +261 <-> 662, 1667 +262 <-> 242, 1285, 1641 +263 <-> 263 +264 <-> 1481 +265 <-> 470, 1671 +266 <-> 971 +267 <-> 1002, 1893 +268 <-> 393, 1435 +269 <-> 413, 806, 1287, 1525 +270 <-> 1182 +271 <-> 1377 +272 <-> 158, 867 +273 <-> 273, 499, 568, 845, 1293 +274 <-> 800 +275 <-> 936 +276 <-> 925 +277 <-> 1295 +278 <-> 1085, 1140 +279 <-> 873, 883, 989 +280 <-> 280 +281 <-> 1211 +282 <-> 445, 674, 1234 +283 <-> 771 +284 <-> 1874 +285 <-> 222, 647, 1092 +286 <-> 53, 1191, 1678 +287 <-> 595, 1928 +288 <-> 947 +289 <-> 822, 1836, 1962 +290 <-> 137, 1034, 1735 +291 <-> 183 +292 <-> 331, 1038 +293 <-> 1025 +294 <-> 201, 630, 1421 +295 <-> 1083, 1366 +296 <-> 701, 1187, 1618 +297 <-> 6, 990 +298 <-> 1093 +299 <-> 299 +300 <-> 846, 1990 +301 <-> 1306 +302 <-> 137, 1011 +303 <-> 67, 106, 1779 +304 <-> 1202 +305 <-> 439 +306 <-> 622, 1858 +307 <-> 1379 +308 <-> 688, 1631, 1700 +309 <-> 133 +310 <-> 166, 362 +311 <-> 28, 933 +312 <-> 881 +313 <-> 22, 549, 678, 1145 +314 <-> 1439 +315 <-> 193, 650, 1572 +316 <-> 243 +317 <-> 317, 990, 1638 +318 <-> 117, 499 +319 <-> 1300, 1309, 1614 +320 <-> 633, 1693 +321 <-> 220, 231 +322 <-> 977, 1722 +323 <-> 730, 1372, 1996 +324 <-> 755, 1184 +325 <-> 1155, 1857 +326 <-> 76 +327 <-> 1072, 1814, 1985 +328 <-> 1125, 1279 +329 <-> 181 +330 <-> 936, 1241 +331 <-> 292, 1172 +332 <-> 1859, 1882 +333 <-> 940 +334 <-> 468 +335 <-> 697, 802 +336 <-> 437 +337 <-> 35, 737 +338 <-> 24, 1540 +339 <-> 493 +340 <-> 111, 422, 525 +341 <-> 1790 +342 <-> 496, 1007 +343 <-> 343, 1264 +344 <-> 34, 344 +345 <-> 244, 709 +346 <-> 553, 1616 +347 <-> 909 +348 <-> 521, 1660 +349 <-> 363, 1294 +350 <-> 719, 1782, 1974 +351 <-> 405, 915 +352 <-> 231, 1694 +353 <-> 1140 +354 <-> 363, 1339 +355 <-> 30 +356 <-> 63, 771, 1110 +357 <-> 1299, 1347 +358 <-> 635 +359 <-> 1541 +360 <-> 96, 360, 1741 +361 <-> 361 +362 <-> 310 +363 <-> 349, 354 +364 <-> 1827 +365 <-> 161, 1734 +366 <-> 900 +367 <-> 1139, 1545 +368 <-> 535 +369 <-> 1622 +370 <-> 166, 1463 +371 <-> 70 +372 <-> 7, 452, 810, 1283 +373 <-> 997, 1658 +374 <-> 467, 1774 +375 <-> 716, 1841 +376 <-> 638, 1079, 1262 +377 <-> 606 +378 <-> 993 +379 <-> 379, 791 +380 <-> 107 +381 <-> 475, 1510 +382 <-> 780 +383 <-> 383 +384 <-> 99, 209, 1590 +385 <-> 1388 +386 <-> 1829 +387 <-> 52, 1532, 1874 +388 <-> 211, 576, 1281 +389 <-> 1309 +390 <-> 201, 1183 +391 <-> 959, 1944 +392 <-> 688, 1062, 1299 +393 <-> 268 +394 <-> 211, 828, 1701 +395 <-> 1587 +396 <-> 1082 +397 <-> 166 +398 <-> 1454, 1508 +399 <-> 1007 +400 <-> 1531 +401 <-> 511, 1140 +402 <-> 652, 1065 +403 <-> 83, 101, 1585 +404 <-> 19, 151 +405 <-> 15, 182, 351 +406 <-> 769 +407 <-> 1275, 1578, 1752 +408 <-> 1173 +409 <-> 409, 432 +410 <-> 487, 1334 +411 <-> 256 +412 <-> 412, 590 +413 <-> 269 +414 <-> 1371 +415 <-> 80, 1832 +416 <-> 939, 1644 +417 <-> 562, 1510 +418 <-> 536 +419 <-> 473 +420 <-> 77, 1059, 1535, 1863 +421 <-> 209 +422 <-> 340, 913, 989 +423 <-> 854, 951 +424 <-> 512 +425 <-> 1087 +426 <-> 773 +427 <-> 1121, 1574 +428 <-> 745 +429 <-> 1669 +430 <-> 1018 +431 <-> 1377 +432 <-> 409 +433 <-> 1641, 1999 +434 <-> 1605 +435 <-> 1412, 1500 +436 <-> 879, 1704 +437 <-> 55, 336, 548, 1839, 1987 +438 <-> 980, 1399 +439 <-> 305, 439, 627, 628, 884, 1241 +440 <-> 211 +441 <-> 677 +442 <-> 86 +443 <-> 1213 +444 <-> 592, 845, 1282 +445 <-> 282, 1366 +446 <-> 710, 797, 1017, 1974 +447 <-> 173, 447, 614 +448 <-> 1187, 1511 +449 <-> 598, 1000, 1257 +450 <-> 259 +451 <-> 451, 519 +452 <-> 372 +453 <-> 1549 +454 <-> 940 +455 <-> 926, 1543, 1706 +456 <-> 682, 1253 +457 <-> 1694, 1755 +458 <-> 549 +459 <-> 1192, 1456, 1613 +460 <-> 21, 490 +461 <-> 1920 +462 <-> 788, 1254, 1695 +463 <-> 26, 149 +464 <-> 945 +465 <-> 1654 +466 <-> 183 +467 <-> 30, 374 +468 <-> 334, 468 +469 <-> 1514 +470 <-> 265 +471 <-> 1190 +472 <-> 1911 +473 <-> 419, 1230, 1611, 1711 +474 <-> 90, 1253 +475 <-> 381, 825 +476 <-> 476, 503 +477 <-> 1337, 1362 +478 <-> 1605 +479 <-> 178 +480 <-> 224, 1810, 1858 +481 <-> 871, 1525 +482 <-> 1137, 1457, 1553 +483 <-> 179, 1336 +484 <-> 5, 1788 +485 <-> 1874 +486 <-> 986, 1409 +487 <-> 410 +488 <-> 1911 +489 <-> 885, 1867 +490 <-> 460 +491 <-> 233, 1046, 1880 +492 <-> 130, 492 +493 <-> 339, 810, 1218 +494 <-> 1275 +495 <-> 1218, 1396 +496 <-> 342, 1445 +497 <-> 548 +498 <-> 729, 1208, 1590 +499 <-> 273, 318, 774 +500 <-> 521, 673, 1035 +501 <-> 504, 978 +502 <-> 641 +503 <-> 476, 615, 1230, 1374 +504 <-> 501 +505 <-> 505, 1336 +506 <-> 1810 +507 <-> 1396 +508 <-> 603, 1067, 1794 +509 <-> 1714 +510 <-> 1441 +511 <-> 401, 1497 +512 <-> 424, 530 +513 <-> 71, 513 +514 <-> 822, 925, 1603 +515 <-> 1575, 1856 +516 <-> 162, 1116, 1634 +517 <-> 936 +518 <-> 177, 1418, 1862 +519 <-> 451 +520 <-> 1318, 1621 +521 <-> 348, 500 +522 <-> 569, 674 +523 <-> 1438 +524 <-> 1181, 1552 +525 <-> 62, 340, 1968 +526 <-> 981 +527 <-> 184, 245, 527, 574, 1767 +528 <-> 873 +529 <-> 945, 1139 +530 <-> 22, 512, 1957 +531 <-> 531 +532 <-> 921, 1071, 1087, 1989 +533 <-> 1845 +534 <-> 534, 1929 +535 <-> 125, 368 +536 <-> 418, 702 +537 <-> 1442, 1545 +538 <-> 552, 1167 +539 <-> 197, 1643 +540 <-> 1983 +541 <-> 1574 +542 <-> 173 +543 <-> 233 +544 <-> 1128 +545 <-> 903, 989 +546 <-> 106, 163, 204 +547 <-> 1636, 1916 +548 <-> 437, 497, 926 +549 <-> 313, 458, 1793 +550 <-> 51 +551 <-> 1756 +552 <-> 538, 1061 +553 <-> 346, 1564 +554 <-> 554 +555 <-> 58, 792, 1221 +556 <-> 1133, 1881 +557 <-> 126, 1222 +558 <-> 183 +559 <-> 1927 +560 <-> 797, 1008, 1048, 1328, 1984 +561 <-> 1294, 1761 +562 <-> 141, 417 +563 <-> 676, 1763 +564 <-> 675, 1220, 1503 +565 <-> 565, 1360 +566 <-> 1364 +567 <-> 618, 1419 +568 <-> 273, 1830 +569 <-> 522, 1642 +570 <-> 778 +571 <-> 881, 1353 +572 <-> 902, 1699 +573 <-> 1679 +574 <-> 527, 656 +575 <-> 718, 1232 +576 <-> 388 +577 <-> 239 +578 <-> 1312 +579 <-> 1504, 1970 +580 <-> 580 +581 <-> 1548, 1893, 1986, 1993 +582 <-> 1228, 1516, 1729 +583 <-> 583, 677, 1178 +584 <-> 1231 +585 <-> 585 +586 <-> 1109, 1646, 1681 +587 <-> 1124, 1237 +588 <-> 1004 +589 <-> 1756 +590 <-> 237, 412 +591 <-> 591, 692, 1078 +592 <-> 444 +593 <-> 4, 944 +594 <-> 1780, 1911 +595 <-> 160, 287 +596 <-> 969, 1256 +597 <-> 830 +598 <-> 449 +599 <-> 1863 +600 <-> 1928 +601 <-> 1079 +602 <-> 1514 +603 <-> 508, 1869 +604 <-> 848, 1234 +605 <-> 605, 952, 1310 +606 <-> 377, 638, 880 +607 <-> 607, 853, 947, 1453 +608 <-> 608, 812 +609 <-> 1091, 1430 +610 <-> 88 +611 <-> 1661 +612 <-> 675 +613 <-> 1409, 1946 +614 <-> 447, 1825, 1992 +615 <-> 503 +616 <-> 616 +617 <-> 758, 1813 +618 <-> 567, 618, 1068 +619 <-> 170 +620 <-> 1937 +621 <-> 734, 1122 +622 <-> 306 +623 <-> 1340 +624 <-> 1644 +625 <-> 1926 +626 <-> 1362, 1528 +627 <-> 439 +628 <-> 439 +629 <-> 221, 1313 +630 <-> 294, 1650 +631 <-> 115, 1770, 1849 +632 <-> 1958 +633 <-> 320, 845, 1445 +634 <-> 46, 1024 +635 <-> 358, 1355, 1778 +636 <-> 1000, 1120 +637 <-> 798, 1009 +638 <-> 376, 606, 1244, 1590 +639 <-> 125, 849 +640 <-> 220 +641 <-> 502, 779, 1675 +642 <-> 740, 1405, 1473, 1702 +643 <-> 930, 1446 +644 <-> 801, 1531, 1886 +645 <-> 1062, 1171, 1595, 1973 +646 <-> 1677, 1751 +647 <-> 47, 285 +648 <-> 1024, 1691 +649 <-> 1743 +650 <-> 315, 819, 876 +651 <-> 1715, 1909 +652 <-> 402, 1777 +653 <-> 143 +654 <-> 868, 1820 +655 <-> 875 +656 <-> 138, 574 +657 <-> 725 +658 <-> 33, 1038 +659 <-> 997 +660 <-> 1438, 1449 +661 <-> 1359, 1736 +662 <-> 261, 1541 +663 <-> 896, 981, 1681 +664 <-> 1538, 1639 +665 <-> 238, 1105 +666 <-> 1036, 1313 +667 <-> 920, 1123 +668 <-> 668, 1808 +669 <-> 174 +670 <-> 670 +671 <-> 767, 1923 +672 <-> 1549, 1564 +673 <-> 500 +674 <-> 282, 522, 1921, 1953 +675 <-> 98, 564, 612, 1260 +676 <-> 563, 1838 +677 <-> 441, 583 +678 <-> 313 +679 <-> 679 +680 <-> 141 +681 <-> 1850 +682 <-> 456 +683 <-> 135, 1880 +684 <-> 1315 +685 <-> 1819, 1966 +686 <-> 161, 786, 796, 1801 +687 <-> 687, 1557 +688 <-> 308, 392 +689 <-> 175, 1899 +690 <-> 952 +691 <-> 691 +692 <-> 591, 1457, 1662 +693 <-> 693 +694 <-> 151 +695 <-> 48, 1436, 1539, 1702, 1903 +696 <-> 696 +697 <-> 335, 1130, 1812, 1823 +698 <-> 1064 +699 <-> 1269, 1807 +700 <-> 755 +701 <-> 296 +702 <-> 136, 536, 702 +703 <-> 834, 1333 +704 <-> 1583, 1731 +705 <-> 1322 +706 <-> 991 +707 <-> 1083 +708 <-> 1382 +709 <-> 125, 345, 948 +710 <-> 446, 1207, 1770 +711 <-> 1831 +712 <-> 1663, 1935 +713 <-> 1410 +714 <-> 968 +715 <-> 788 +716 <-> 35, 375 +717 <-> 124, 1265, 1495, 1639 +718 <-> 575 +719 <-> 350 +720 <-> 811 +721 <-> 1827 +722 <-> 722, 1492, 1650 +723 <-> 1967 +724 <-> 1059, 1726 +725 <-> 657, 725 +726 <-> 251 +727 <-> 1129 +728 <-> 1459 +729 <-> 498 +730 <-> 323, 1617 +731 <-> 178 +732 <-> 1375 +733 <-> 953, 1384 +734 <-> 621, 1312, 1911, 1955 +735 <-> 1100, 1117 +736 <-> 1180 +737 <-> 337 +738 <-> 27, 738 +739 <-> 888 +740 <-> 642 +741 <-> 1132, 1304, 1680 +742 <-> 1615 +743 <-> 7, 1766 +744 <-> 744 +745 <-> 428, 857, 969, 1179, 1180 +746 <-> 751 +747 <-> 1256 +748 <-> 1528 +749 <-> 251, 912, 1686 +750 <-> 106 +751 <-> 746, 751 +752 <-> 1354, 1498, 1571 +753 <-> 255 +754 <-> 908, 1066, 1589 +755 <-> 324, 700 +756 <-> 1013 +757 <-> 814 +758 <-> 89, 617, 1602 +759 <-> 1550 +760 <-> 1047 +761 <-> 970, 1129 +762 <-> 1508 +763 <-> 1329 +764 <-> 765, 1415 +765 <-> 764, 1908 +766 <-> 1197, 1595 +767 <-> 671 +768 <-> 1457 +769 <-> 406, 852 +770 <-> 770, 1427 +771 <-> 25, 283, 356 +772 <-> 1606, 1823 +773 <-> 426, 1836 +774 <-> 499 +775 <-> 1031, 1733 +776 <-> 1035, 1567 +777 <-> 18, 159 +778 <-> 570, 1994 +779 <-> 641 +780 <-> 382, 1703, 1928 +781 <-> 1647 +782 <-> 1367 +783 <-> 1454, 1609, 1785 +784 <-> 1243, 1380 +785 <-> 1236 +786 <-> 686, 1050, 1413 +787 <-> 1026, 1613 +788 <-> 462, 715, 1855 +789 <-> 789, 1021, 1186, 1573 +790 <-> 1744 +791 <-> 379 +792 <-> 555, 1041, 1107 +793 <-> 228, 1194 +794 <-> 864, 1591, 1612 +795 <-> 795, 1478 +796 <-> 686, 1652 +797 <-> 189, 446, 560 +798 <-> 637, 1342 +799 <-> 799, 1890 +800 <-> 274, 800, 1578 +801 <-> 644, 1618, 1732 +802 <-> 335 +803 <-> 803, 1497 +804 <-> 804 +805 <-> 805 +806 <-> 269 +807 <-> 817, 987 +808 <-> 1445 +809 <-> 223, 1489 +810 <-> 372, 493, 1397 +811 <-> 720, 1786 +812 <-> 37, 608 +813 <-> 1410 +814 <-> 757, 928, 1201, 1305 +815 <-> 1079, 1443 +816 <-> 1563 +817 <-> 807, 1614 +818 <-> 239, 1135 +819 <-> 94, 650 +820 <-> 820, 1747 +821 <-> 827 +822 <-> 230, 289, 514 +823 <-> 1397 +824 <-> 899 +825 <-> 475 +826 <-> 1468, 1696 +827 <-> 821, 1238 +828 <-> 394, 1459 +829 <-> 1372, 1448 +830 <-> 597, 1112 +831 <-> 831 +832 <-> 832 +833 <-> 833 +834 <-> 212, 703, 1913 +835 <-> 835 +836 <-> 1904 +837 <-> 46 +838 <-> 1512 +839 <-> 202, 1510, 1690 +840 <-> 842 +841 <-> 1430 +842 <-> 840, 1397 +843 <-> 955, 1303, 1500, 1845 +844 <-> 1221 +845 <-> 219, 273, 444, 633, 1434 +846 <-> 258, 300 +847 <-> 847 +848 <-> 604, 1960 +849 <-> 639, 1126, 1601 +850 <-> 1027, 1818, 1899 +851 <-> 1124, 1536 +852 <-> 769, 852, 1551, 1727 +853 <-> 607, 1885 +854 <-> 423, 1544 +855 <-> 1889 +856 <-> 981, 1683 +857 <-> 745 +858 <-> 858, 1041 +859 <-> 859, 1465 +860 <-> 860, 1288 +861 <-> 235, 1133 +862 <-> 979, 1255, 1484 +863 <-> 147 +864 <-> 794 +865 <-> 865, 902 +866 <-> 1033, 1367 +867 <-> 76, 186, 272, 1205 +868 <-> 185, 654 +869 <-> 895 +870 <-> 1082 +871 <-> 481, 1151 +872 <-> 872 +873 <-> 279, 528 +874 <-> 1358, 1787 +875 <-> 14, 655 +876 <-> 650, 1227 +877 <-> 239, 1674 +878 <-> 878 +879 <-> 436, 1786, 1844 +880 <-> 606, 1181 +881 <-> 312, 571 +882 <-> 139 +883 <-> 279, 1498, 1746 +884 <-> 439 +885 <-> 489 +886 <-> 1592 +887 <-> 919 +888 <-> 739, 1958 +889 <-> 1930 +890 <-> 1026, 1326 +891 <-> 183, 891 +892 <-> 1984 +893 <-> 1078 +894 <-> 1178, 1329 +895 <-> 869, 1863 +896 <-> 663 +897 <-> 1693 +898 <-> 119, 1316 +899 <-> 34, 824 +900 <-> 366, 900 +901 <-> 48, 1030 +902 <-> 572, 865, 973 +903 <-> 545 +904 <-> 225, 1083 +905 <-> 1172, 1274, 1507 +906 <-> 1878 +907 <-> 1372 +908 <-> 754, 1485, 1923 +909 <-> 347, 909 +910 <-> 1335, 1621 +911 <-> 228, 1077, 1736 +912 <-> 173, 749 +913 <-> 422, 1688 +914 <-> 1232, 1615 +915 <-> 351, 1889 +916 <-> 97, 1593 +917 <-> 1574 +918 <-> 1254, 1829, 1940 +919 <-> 887, 1284, 1392 +920 <-> 667, 1480 +921 <-> 532, 1296, 1712 +922 <-> 922 +923 <-> 1194 +924 <-> 1931 +925 <-> 276, 514 +926 <-> 455, 548 +927 <-> 1241 +928 <-> 814 +929 <-> 1276, 1645 +930 <-> 643 +931 <-> 1868 +932 <-> 1823 +933 <-> 311 +934 <-> 8, 250, 1416, 1886 +935 <-> 1927 +936 <-> 275, 330, 517 +937 <-> 1692, 1867 +938 <-> 1050 +939 <-> 416, 1430 +940 <-> 333, 454, 1094, 1980 +941 <-> 1698 +942 <-> 23, 1642 +943 <-> 1102 +944 <-> 593, 1365, 1577 +945 <-> 464, 529, 945 +946 <-> 241, 1037 +947 <-> 103, 288, 607, 1095 +948 <-> 709, 1217 +949 <-> 1960 +950 <-> 91, 1862 +951 <-> 423 +952 <-> 605, 690 +953 <-> 733, 1894 +954 <-> 1113, 1978, 1988 +955 <-> 843 +956 <-> 956 +957 <-> 1122 +958 <-> 3, 81 +959 <-> 391, 1383, 1711 +960 <-> 1280, 1796 +961 <-> 77 +962 <-> 1509 +963 <-> 963, 1788, 1897 +964 <-> 1810 +965 <-> 1147 +966 <-> 1741 +967 <-> 1979 +968 <-> 714, 968 +969 <-> 87, 596, 745, 1082 +970 <-> 761, 1495 +971 <-> 266, 971 +972 <-> 972 +973 <-> 902, 1398 +974 <-> 1862 +975 <-> 105, 138, 1118 +976 <-> 1369 +977 <-> 322, 1970 +978 <-> 501, 1270 +979 <-> 862, 1244 +980 <-> 155, 438, 1072, 1176 +981 <-> 526, 663, 856, 1355 +982 <-> 1344 +983 <-> 1947 +984 <-> 1221 +985 <-> 1042 +986 <-> 202, 486, 1635 +987 <-> 162, 807, 1267 +988 <-> 988 +989 <-> 279, 422, 545, 1128 +990 <-> 297, 317, 1891 +991 <-> 706, 1229, 1712 +992 <-> 1269 +993 <-> 378, 1441 +994 <-> 12 +995 <-> 1693 +996 <-> 17, 191 +997 <-> 373, 659, 1678 +998 <-> 1278 +999 <-> 109 +1000 <-> 449, 636 +1001 <-> 1922 +1002 <-> 267 +1003 <-> 1989 +1004 <-> 163, 588 +1005 <-> 1159, 1247, 1261 +1006 <-> 1218 +1007 <-> 342, 399, 1148 +1008 <-> 560 +1009 <-> 637, 1129 +1010 <-> 1257 +1011 <-> 302 +1012 <-> 26, 1184, 1866, 1937 +1013 <-> 756, 1150 +1014 <-> 1014 +1015 <-> 1281 +1016 <-> 1720 +1017 <-> 446 +1018 <-> 124, 430 +1019 <-> 1341 +1020 <-> 1369, 1666 +1021 <-> 789 +1022 <-> 1022, 1102, 1675 +1023 <-> 28, 1630 +1024 <-> 634, 648 +1025 <-> 293, 1263, 1317 +1026 <-> 787, 890 +1027 <-> 13, 850 +1028 <-> 1334 +1029 <-> 1029, 1147 +1030 <-> 901 +1031 <-> 775, 1674 +1032 <-> 1720, 1757, 1764, 1892 +1033 <-> 215, 866, 1189, 1930 +1034 <-> 290, 1988 +1035 <-> 500, 776 +1036 <-> 116, 666, 1036, 1707 +1037 <-> 946 +1038 <-> 292, 658, 1932 +1039 <-> 216 +1040 <-> 1867 +1041 <-> 792, 858 +1042 <-> 985, 1969, 1998 +1043 <-> 1069 +1044 <-> 227 +1045 <-> 1045, 1404 +1046 <-> 122, 491, 1046 +1047 <-> 760, 1309 +1048 <-> 560, 1316, 1370 +1049 <-> 133, 1936 +1050 <-> 786, 938, 1050 +1051 <-> 1371, 1533 +1052 <-> 120, 1106, 1901 +1053 <-> 1489, 1675 +1054 <-> 1075, 1905 +1055 <-> 1543 +1056 <-> 163, 1056 +1057 <-> 1525, 1635, 1870 +1058 <-> 1545 +1059 <-> 109, 420, 724, 1781 +1060 <-> 126, 1308 +1061 <-> 552, 1065, 1543, 1594 +1062 <-> 259, 392, 645, 1414 +1063 <-> 113, 1520, 1976 +1064 <-> 698, 1254 +1065 <-> 402, 1061, 1496 +1066 <-> 249, 754, 1546 +1067 <-> 115, 508 +1068 <-> 618 +1069 <-> 1043, 1240, 1461, 1632 +1070 <-> 1266, 1904 +1071 <-> 532, 1514 +1072 <-> 327, 980, 1985 +1073 <-> 57 +1074 <-> 1833 +1075 <-> 29, 44, 80, 1054 +1076 <-> 143, 1778, 1940 +1077 <-> 911 +1078 <-> 591, 893, 1629 +1079 <-> 376, 601, 815, 1840 +1080 <-> 1144, 1295, 1330, 1765 +1081 <-> 89 +1082 <-> 396, 870, 969, 1498 +1083 <-> 295, 707, 904 +1084 <-> 1084 +1085 <-> 278 +1086 <-> 1659, 1661 +1087 <-> 425, 532 +1088 <-> 170 +1089 <-> 81, 1089, 1219, 1913 +1090 <-> 147, 1099 +1091 <-> 609, 1579, 1779 +1092 <-> 285 +1093 <-> 298, 1520 +1094 <-> 940 +1095 <-> 947 +1096 <-> 1096 +1097 <-> 260 +1098 <-> 126, 1682 +1099 <-> 1090 +1100 <-> 735 +1101 <-> 1848 +1102 <-> 213, 943, 1022 +1103 <-> 131 +1104 <-> 1783 +1105 <-> 665 +1106 <-> 1052, 1106 +1107 <-> 792 +1108 <-> 56 +1109 <-> 586 +1110 <-> 356, 1259 +1111 <-> 1133 +1112 <-> 830, 1820 +1113 <-> 954 +1114 <-> 1114, 1475 +1115 <-> 1115 +1116 <-> 516 +1117 <-> 243, 735 +1118 <-> 975, 1689 +1119 <-> 1235, 1337, 1474, 1741, 1994 +1120 <-> 636 +1121 <-> 427 +1122 <-> 621, 957 +1123 <-> 667, 1123 +1124 <-> 587, 851, 1250, 1953 +1125 <-> 23, 32, 40, 328 +1126 <-> 849, 1429, 1676 +1127 <-> 123, 1998 +1128 <-> 544, 989 +1129 <-> 727, 761, 1009, 1691 +1130 <-> 697 +1131 <-> 1436, 1719 +1132 <-> 741, 1278 +1133 <-> 556, 861, 1111 +1134 <-> 1795, 1956 +1135 <-> 68, 818 +1136 <-> 185 +1137 <-> 31, 482, 1466 +1138 <-> 148, 1953 +1139 <-> 367, 529, 1154 +1140 <-> 278, 353, 401, 1608 +1141 <-> 1141 +1142 <-> 1690, 1809 +1143 <-> 46, 1495 +1144 <-> 1080, 1580 +1145 <-> 313, 1772 +1146 <-> 97 +1147 <-> 965, 1029, 1648 +1148 <-> 1007 +1149 <-> 33 +1150 <-> 1013, 1417, 1864 +1151 <-> 871, 1990 +1152 <-> 1229, 1572 +1153 <-> 159, 1228 +1154 <-> 1139 +1155 <-> 325, 1829 +1156 <-> 1650 +1157 <-> 1489 +1158 <-> 1472 +1159 <-> 1005 +1160 <-> 1467 +1161 <-> 51 +1162 <-> 1254 +1163 <-> 1331 +1164 <-> 1895 +1165 <-> 1165, 1214, 1345 +1166 <-> 1254 +1167 <-> 538 +1168 <-> 217, 1223, 1818 +1169 <-> 1169, 1514, 1761 +1170 <-> 1948 +1171 <-> 645 +1172 <-> 331, 905 +1173 <-> 408, 1535 +1174 <-> 1203, 1238, 1472 +1175 <-> 182, 1817 +1176 <-> 980 +1177 <-> 1307, 1463 +1178 <-> 583, 894, 1800, 1971 +1179 <-> 745, 1259 +1180 <-> 736, 745 +1181 <-> 524, 880 +1182 <-> 270, 1216, 1878 +1183 <-> 390 +1184 <-> 324, 1012, 1356 +1185 <-> 249 +1186 <-> 789 +1187 <-> 64, 296, 448, 1377, 1488 +1188 <-> 136, 1320 +1189 <-> 1033, 1823 +1190 <-> 225, 256, 471 +1191 <-> 132, 286, 1802 +1192 <-> 459 +1193 <-> 154, 1193 +1194 <-> 793, 923, 1479 +1195 <-> 38, 1766 +1196 <-> 1196, 1470 +1197 <-> 766 +1198 <-> 194, 1252 +1199 <-> 1199 +1200 <-> 140, 1200 +1201 <-> 814, 1802 +1202 <-> 304, 1865 +1203 <-> 1174 +1204 <-> 1583 +1205 <-> 57, 211, 867, 1331, 1784, 1819 +1206 <-> 1286 +1207 <-> 710 +1208 <-> 498 +1209 <-> 160, 1209 +1210 <-> 1210, 1599 +1211 <-> 14, 281, 1278 +1212 <-> 1289, 1644 +1213 <-> 443, 1714, 1863 +1214 <-> 1165 +1215 <-> 1215 +1216 <-> 1182, 1436 +1217 <-> 948, 1377 +1218 <-> 493, 495, 1006 +1219 <-> 1089 +1220 <-> 564 +1221 <-> 555, 844, 984 +1222 <-> 557 +1223 <-> 150, 1168 +1224 <-> 9 +1225 <-> 1323 +1226 <-> 242 +1227 <-> 876, 1314 +1228 <-> 150, 582, 1153, 1918 +1229 <-> 991, 1152 +1230 <-> 473, 503, 1444, 1945 +1231 <-> 54, 584, 1713 +1232 <-> 575, 914, 1232 +1233 <-> 79, 142, 1776 +1234 <-> 282, 604 +1235 <-> 1119 +1236 <-> 785, 1236 +1237 <-> 587, 1751 +1238 <-> 827, 1174, 1417 +1239 <-> 150, 1597, 1852 +1240 <-> 1069, 1769 +1241 <-> 330, 439, 927 +1242 <-> 1242 +1243 <-> 784, 1541 +1244 <-> 11, 638, 979 +1245 <-> 1245 +1246 <-> 237, 1330 +1247 <-> 1005, 1598 +1248 <-> 1573 +1249 <-> 209, 1522 +1250 <-> 1124 +1251 <-> 63 +1252 <-> 1198 +1253 <-> 456, 474 +1254 <-> 462, 918, 1064, 1162, 1166 +1255 <-> 862 +1256 <-> 596, 747 +1257 <-> 449, 1010, 1568, 1837 +1258 <-> 1803 +1259 <-> 1110, 1179 +1260 <-> 675 +1261 <-> 1005, 1753 +1262 <-> 376, 1318 +1263 <-> 1025, 1887 +1264 <-> 343 +1265 <-> 717 +1266 <-> 1070 +1267 <-> 987, 1368 +1268 <-> 1268 +1269 <-> 118, 699, 992, 1939 +1270 <-> 157, 978 +1271 <-> 219 +1272 <-> 1858 +1273 <-> 218 +1274 <-> 905 +1275 <-> 407, 494 +1276 <-> 26, 929 +1277 <-> 1919, 1982 +1278 <-> 998, 1132, 1211 +1279 <-> 138, 328, 1852, 1912 +1280 <-> 960 +1281 <-> 102, 113, 388, 1015, 1877 +1282 <-> 444 +1283 <-> 372, 1562 +1284 <-> 919 +1285 <-> 262 +1286 <-> 127, 1206, 1286, 1875 +1287 <-> 269 +1288 <-> 860, 1736 +1289 <-> 1212, 1321, 1424 +1290 <-> 1319, 1884, 1959, 1978 +1291 <-> 1291, 1998 +1292 <-> 55 +1293 <-> 273, 1995 +1294 <-> 227, 349, 561 +1295 <-> 277, 1080, 1570 +1296 <-> 921, 1714 +1297 <-> 1297 +1298 <-> 1518, 1733 +1299 <-> 357, 392 +1300 <-> 319 +1301 <-> 1301 +1302 <-> 1912 +1303 <-> 843 +1304 <-> 741 +1305 <-> 814, 1828 +1306 <-> 301, 1610 +1307 <-> 190, 1177 +1308 <-> 1060 +1309 <-> 319, 389, 1047 +1310 <-> 605 +1311 <-> 1463 +1312 <-> 578, 734 +1313 <-> 629, 666 +1314 <-> 1227, 1980 +1315 <-> 684, 1472 +1316 <-> 898, 1048 +1317 <-> 1025 +1318 <-> 520, 1262 +1319 <-> 1290 +1320 <-> 1188 +1321 <-> 1289, 1737 +1322 <-> 705, 1501 +1323 <-> 1225, 1323 +1324 <-> 1720 +1325 <-> 1837 +1326 <-> 890 +1327 <-> 1470, 1914 +1328 <-> 560 +1329 <-> 763, 894 +1330 <-> 1080, 1246 +1331 <-> 1163, 1205 +1332 <-> 1332 +1333 <-> 703 +1334 <-> 144, 410, 1028, 1854, 1871, 1925 +1335 <-> 246, 910, 1807 +1336 <-> 483, 505 +1337 <-> 255, 477, 1119 +1338 <-> 1455, 1810 +1339 <-> 354, 1845 +1340 <-> 623, 1627 +1341 <-> 62, 1019, 1841 +1342 <-> 798 +1343 <-> 1343 +1344 <-> 982, 1344 +1345 <-> 1165, 1369 +1346 <-> 1410, 1643 +1347 <-> 357 +1348 <-> 1623 +1349 <-> 235, 1991 +1350 <-> 1698 +1351 <-> 1669 +1352 <-> 1352 +1353 <-> 571, 1519, 1657 +1354 <-> 80, 752 +1355 <-> 635, 981 +1356 <-> 1184 +1357 <-> 1679 +1358 <-> 874, 1838 +1359 <-> 661 +1360 <-> 565, 1555 +1361 <-> 134 +1362 <-> 477, 626 +1363 <-> 1459 +1364 <-> 566, 1791 +1365 <-> 20, 944, 1465 +1366 <-> 295, 445 +1367 <-> 782, 866 +1368 <-> 1267 +1369 <-> 976, 1020, 1345 +1370 <-> 1048 +1371 <-> 223, 414, 1051 +1372 <-> 323, 829, 907 +1373 <-> 1373 +1374 <-> 503 +1375 <-> 732, 1375 +1376 <-> 1376 +1377 <-> 271, 431, 1187, 1217 +1378 <-> 225 +1379 <-> 307, 1379, 1507 +1380 <-> 784, 1870 +1381 <-> 1381, 1569 +1382 <-> 708, 1839 +1383 <-> 959, 1586 +1384 <-> 733, 1716 +1385 <-> 1385 +1386 <-> 1386 +1387 <-> 101 +1388 <-> 385, 1777 +1389 <-> 152 +1390 <-> 134, 1669 +1391 <-> 1924 +1392 <-> 245, 919 +1393 <-> 1904 +1394 <-> 10 +1395 <-> 1582 +1396 <-> 495, 507, 1622, 1902 +1397 <-> 810, 823, 842 +1398 <-> 973 +1399 <-> 438, 1670, 1671 +1400 <-> 1400 +1401 <-> 195, 1649 +1402 <-> 1402 +1403 <-> 1603 +1404 <-> 1045 +1405 <-> 642 +1406 <-> 1562, 1668 +1407 <-> 1606 +1408 <-> 1408 +1409 <-> 486, 613 +1410 <-> 59, 713, 813, 1346 +1411 <-> 1666 +1412 <-> 435 +1413 <-> 786, 1709 +1414 <-> 53, 1062, 1600 +1415 <-> 764, 1558 +1416 <-> 35, 934 +1417 <-> 1150, 1238 +1418 <-> 518 +1419 <-> 567 +1420 <-> 1858 +1421 <-> 294 +1422 <-> 177 +1423 <-> 1668 +1424 <-> 1289 +1425 <-> 77 +1426 <-> 1870, 1943 +1427 <-> 770 +1428 <-> 1428 +1429 <-> 1126 +1430 <-> 609, 841, 939, 1826 +1431 <-> 21 +1432 <-> 1975 +1433 <-> 131 +1434 <-> 845, 1487 +1435 <-> 268, 1597 +1436 <-> 695, 1131, 1216 +1437 <-> 16, 1910 +1438 <-> 523, 660, 1438 +1439 <-> 241, 314 +1440 <-> 1714 +1441 <-> 241, 510, 993 +1442 <-> 537 +1443 <-> 815 +1444 <-> 1230 +1445 <-> 496, 633, 808 +1446 <-> 167, 643, 1526 +1447 <-> 1848 +1448 <-> 829, 1709 +1449 <-> 660 +1450 <-> 229 +1451 <-> 1481, 1527 +1452 <-> 1452 +1453 <-> 607 +1454 <-> 398, 783 +1455 <-> 1338, 1618 +1456 <-> 459 +1457 <-> 482, 692, 768, 1512 +1458 <-> 1752 +1459 <-> 728, 828, 1363 +1460 <-> 1625 +1461 <-> 28, 158, 1069, 1926 +1462 <-> 1462 +1463 <-> 370, 1177, 1311 +1464 <-> 1935 +1465 <-> 859, 1365 +1466 <-> 1137 +1467 <-> 129, 1160 +1468 <-> 826 +1469 <-> 1524 +1470 <-> 1196, 1327 +1471 <-> 1799, 1993 +1472 <-> 1158, 1174, 1315, 1472, 1502, 1981 +1473 <-> 642 +1474 <-> 1119 +1475 <-> 1114, 1513 +1476 <-> 16, 1598 +1477 <-> 1477 +1478 <-> 795 +1479 <-> 1194 +1480 <-> 920 +1481 <-> 264, 1451, 1504, 1952 +1482 <-> 1795 +1483 <-> 1984 +1484 <-> 862, 1629 +1485 <-> 908 +1486 <-> 222 +1487 <-> 1434 +1488 <-> 1187 +1489 <-> 9, 809, 1053, 1157, 1490 +1490 <-> 1489 +1491 <-> 1872 +1492 <-> 722 +1493 <-> 177 +1494 <-> 1824 +1495 <-> 75, 717, 970, 1143 +1496 <-> 1065 +1497 <-> 511, 803 +1498 <-> 752, 883, 1082 +1499 <-> 1646 +1500 <-> 435, 843 +1501 <-> 1322, 1501, 1753 +1502 <-> 98, 1472 +1503 <-> 564 +1504 <-> 190, 579, 1481 +1505 <-> 1527 +1506 <-> 1939 +1507 <-> 88, 905, 1379 +1508 <-> 222, 398, 762 +1509 <-> 170, 962, 1509 +1510 <-> 381, 417, 839 +1511 <-> 448 +1512 <-> 838, 1457 +1513 <-> 1475 +1514 <-> 469, 602, 1071, 1169 +1515 <-> 1766 +1516 <-> 582 +1517 <-> 78, 1555 +1518 <-> 1298 +1519 <-> 1353, 1918 +1520 <-> 1063, 1093 +1521 <-> 89 +1522 <-> 1249 +1523 <-> 1566 +1524 <-> 19, 1469 +1525 <-> 2, 269, 481, 1057 +1526 <-> 245, 1446 +1527 <-> 137, 1451, 1505, 1948 +1528 <-> 626, 748, 1771 +1529 <-> 1618 +1530 <-> 1530 +1531 <-> 400, 644 +1532 <-> 387 +1533 <-> 1051, 1725 +1534 <-> 1658, 1696 +1535 <-> 420, 1173, 1867 +1536 <-> 851 +1537 <-> 139 +1538 <-> 664 +1539 <-> 19, 695 +1540 <-> 338 +1541 <-> 359, 662, 1243 +1542 <-> 4, 139 +1543 <-> 0, 455, 1055, 1061, 1604 +1544 <-> 854, 1619 +1545 <-> 367, 537, 1058 +1546 <-> 1066 +1547 <-> 25 +1548 <-> 581, 1917 +1549 <-> 453, 672 +1550 <-> 40, 759 +1551 <-> 852 +1552 <-> 524 +1553 <-> 482 +1554 <-> 91 +1555 <-> 1360, 1517, 1833 +1556 <-> 1869 +1557 <-> 687 +1558 <-> 1415 +1559 <-> 1559, 1773 +1560 <-> 1693 +1561 <-> 25 +1562 <-> 1283, 1406 +1563 <-> 816, 1563, 1768 +1564 <-> 553, 672, 1892 +1565 <-> 57, 1665 +1566 <-> 98, 1523, 1907 +1567 <-> 776 +1568 <-> 1257, 1998 +1569 <-> 1381 +1570 <-> 1295 +1571 <-> 752, 1827 +1572 <-> 248, 315, 1152 +1573 <-> 789, 1248, 1772 +1574 <-> 427, 541, 917, 1796, 1882 +1575 <-> 135, 515 +1576 <-> 1957 +1577 <-> 944 +1578 <-> 407, 800 +1579 <-> 1091 +1580 <-> 1144 +1581 <-> 195 +1582 <-> 65, 1395, 1582 +1583 <-> 704, 1204 +1584 <-> 1584 +1585 <-> 403, 1889 +1586 <-> 1383 +1587 <-> 395, 1587 +1588 <-> 1983 +1589 <-> 754 +1590 <-> 384, 498, 638 +1591 <-> 794 +1592 <-> 886, 1608 +1593 <-> 249, 916 +1594 <-> 1061 +1595 <-> 645, 766 +1596 <-> 89, 153 +1597 <-> 56, 1239, 1435 +1598 <-> 50, 1247, 1476 +1599 <-> 1210 +1600 <-> 1414 +1601 <-> 199, 849 +1602 <-> 758 +1603 <-> 514, 1403, 1792 +1604 <-> 1543, 1979 +1605 <-> 30, 434, 478, 1961 +1606 <-> 772, 1407 +1607 <-> 1607, 1653 +1608 <-> 1140, 1592 +1609 <-> 783 +1610 <-> 171, 1306, 1744 +1611 <-> 473 +1612 <-> 794, 1859 +1613 <-> 459, 787, 1613 +1614 <-> 319, 817, 1616, 1924 +1615 <-> 178, 742, 914 +1616 <-> 346, 1614 +1617 <-> 74, 110, 200, 730 +1618 <-> 296, 801, 1455, 1529 +1619 <-> 50, 1544 +1620 <-> 260 +1621 <-> 520, 910, 1748 +1622 <-> 172, 187, 369, 1396 +1623 <-> 1348, 1623 +1624 <-> 21 +1625 <-> 1460, 1625, 1936, 1963 +1626 <-> 96 +1627 <-> 1340, 1677 +1628 <-> 1628, 1728 +1629 <-> 1078, 1484 +1630 <-> 1023 +1631 <-> 308 +1632 <-> 1069 +1633 <-> 1669, 1935 +1634 <-> 187, 516 +1635 <-> 986, 1057 +1636 <-> 547, 1762 +1637 <-> 1637 +1638 <-> 317 +1639 <-> 664, 717 +1640 <-> 126 +1641 <-> 36, 262, 433 +1642 <-> 569, 942 +1643 <-> 539, 1346, 1745 +1644 <-> 416, 624, 1212, 1931 +1645 <-> 929 +1646 <-> 586, 1499, 1687 +1647 <-> 242, 781, 1723 +1648 <-> 1147, 1947 +1649 <-> 1401 +1650 <-> 630, 722, 1156, 1869 +1651 <-> 1943 +1652 <-> 796 +1653 <-> 1607 +1654 <-> 465, 1970 +1655 <-> 1987 +1656 <-> 1656 +1657 <-> 1353 +1658 <-> 373, 1534 +1659 <-> 1086 +1660 <-> 348, 1660 +1661 <-> 242, 611, 1086 +1662 <-> 692 +1663 <-> 712 +1664 <-> 257 +1665 <-> 1565 +1666 <-> 1020, 1411, 1887, 1967 +1667 <-> 261 +1668 <-> 1406, 1423 +1669 <-> 429, 1351, 1390, 1633, 1938 +1670 <-> 1399 +1671 <-> 265, 1399 +1672 <-> 152, 1684, 1707 +1673 <-> 205 +1674 <-> 877, 1031, 1991 +1675 <-> 641, 1022, 1053, 1920 +1676 <-> 1126 +1677 <-> 82, 646, 1627 +1678 <-> 286, 997 +1679 <-> 208, 573, 1357 +1680 <-> 169, 741 +1681 <-> 586, 663, 1811 +1682 <-> 1, 1098 +1683 <-> 203, 856, 1817 +1684 <-> 1672, 1927 +1685 <-> 182, 1950 +1686 <-> 749 +1687 <-> 174, 1646 +1688 <-> 913 +1689 <-> 1118 +1690 <-> 839, 1142 +1691 <-> 648, 1129 +1692 <-> 937 +1693 <-> 320, 897, 995, 1560, 1716 +1694 <-> 352, 457 +1695 <-> 462 +1696 <-> 165, 826, 1534 +1697 <-> 1877 +1698 <-> 172, 941, 1350 +1699 <-> 572 +1700 <-> 308 +1701 <-> 394, 1843 +1702 <-> 642, 695, 1861 +1703 <-> 780, 1909 +1704 <-> 436 +1705 <-> 1906 +1706 <-> 455 +1707 <-> 1036, 1672, 1854 +1708 <-> 1708 +1709 <-> 1413, 1448 +1710 <-> 1822 +1711 <-> 473, 959 +1712 <-> 921, 991 +1713 <-> 1231 +1714 <-> 509, 1213, 1296, 1440, 1999 +1715 <-> 651 +1716 <-> 1384, 1693 +1717 <-> 101 +1718 <-> 178 +1719 <-> 1131 +1720 <-> 1016, 1032, 1324 +1721 <-> 210 +1722 <-> 322 +1723 <-> 1647 +1724 <-> 1724, 1738 +1725 <-> 1533, 1743 +1726 <-> 724 +1727 <-> 852 +1728 <-> 1628 +1729 <-> 582 +1730 <-> 1733, 1935 +1731 <-> 257, 704, 1989 +1732 <-> 801 +1733 <-> 775, 1298, 1730, 1762 +1734 <-> 365 +1735 <-> 60, 290 +1736 <-> 661, 911, 1288, 1749 +1737 <-> 1321 +1738 <-> 236, 1724 +1739 <-> 28 +1740 <-> 31 +1741 <-> 360, 966, 1119 +1742 <-> 68 +1743 <-> 649, 1725 +1744 <-> 790, 1610 +1745 <-> 1643 +1746 <-> 883 +1747 <-> 820 +1748 <-> 1621 +1749 <-> 1736 +1750 <-> 1750 +1751 <-> 646, 1237 +1752 <-> 407, 1458 +1753 <-> 1261, 1501 +1754 <-> 247 +1755 <-> 457, 1855 +1756 <-> 32, 551, 589 +1757 <-> 1032 +1758 <-> 113 +1759 <-> 1848 +1760 <-> 26 +1761 <-> 561, 1169 +1762 <-> 1636, 1733 +1763 <-> 563 +1764 <-> 1032 +1765 <-> 254, 1080 +1766 <-> 743, 1195, 1515 +1767 <-> 527 +1768 <-> 1563 +1769 <-> 1240 +1770 <-> 631, 710 +1771 <-> 1528 +1772 <-> 1145, 1573 +1773 <-> 1559 +1774 <-> 374 +1775 <-> 250 +1776 <-> 200, 1233 +1777 <-> 652, 1388 +1778 <-> 635, 1076 +1779 <-> 303, 1091 +1780 <-> 35, 594 +1781 <-> 1059 +1782 <-> 350, 1964 +1783 <-> 1104, 1837, 1879 +1784 <-> 1205 +1785 <-> 783 +1786 <-> 811, 879, 1786, 1847 +1787 <-> 874, 1829 +1788 <-> 484, 963 +1789 <-> 1858 +1790 <-> 33, 341 +1791 <-> 1364, 1791 +1792 <-> 1603, 1792, 1868 +1793 <-> 549 +1794 <-> 508 +1795 <-> 1134, 1482 +1796 <-> 960, 1574 +1797 <-> 145 +1798 <-> 1798 +1799 <-> 1471 +1800 <-> 1178 +1801 <-> 686 +1802 <-> 1191, 1201 +1803 <-> 214, 1258, 1819 +1804 <-> 1819 +1805 <-> 237 +1806 <-> 1973 +1807 <-> 699, 1335 +1808 <-> 668, 1898 +1809 <-> 1142, 1987 +1810 <-> 192, 480, 506, 964, 1338 +1811 <-> 1681 +1812 <-> 697 +1813 <-> 617, 1910 +1814 <-> 327 +1815 <-> 1953 +1816 <-> 176 +1817 <-> 1175, 1683 +1818 <-> 850, 1168 +1819 <-> 685, 1205, 1803, 1804 +1820 <-> 654, 1112 +1821 <-> 250 +1822 <-> 1710, 1957 +1823 <-> 697, 772, 932, 1189 +1824 <-> 1494, 1848 +1825 <-> 206, 614 +1826 <-> 1430 +1827 <-> 364, 721, 1571 +1828 <-> 1305 +1829 <-> 386, 918, 1155, 1787 +1830 <-> 568 +1831 <-> 215, 243, 711 +1832 <-> 415, 1832 +1833 <-> 1074, 1555 +1834 <-> 1834 +1835 <-> 1835 +1836 <-> 289, 773 +1837 <-> 1257, 1325, 1783 +1838 <-> 676, 1358 +1839 <-> 437, 1382, 1872 +1840 <-> 1079 +1841 <-> 375, 1341 +1842 <-> 247, 1850 +1843 <-> 1701 +1844 <-> 879 +1845 <-> 533, 843, 1339 +1846 <-> 1870 +1847 <-> 1786, 1972 +1848 <-> 1101, 1447, 1759, 1824, 1848, 1873 +1849 <-> 631 +1850 <-> 681, 1842 +1851 <-> 1851 +1852 <-> 1239, 1279 +1853 <-> 28, 1997 +1854 <-> 1334, 1707 +1855 <-> 788, 1755 +1856 <-> 515 +1857 <-> 212, 325 +1858 <-> 306, 480, 1272, 1420, 1789 +1859 <-> 332, 1612 +1860 <-> 1977 +1861 <-> 1702 +1862 <-> 518, 950, 974, 1862 +1863 <-> 420, 599, 895, 1213 +1864 <-> 1150 +1865 <-> 45, 141, 1202 +1866 <-> 1012 +1867 <-> 489, 937, 1040, 1535 +1868 <-> 931, 1792 +1869 <-> 603, 1556, 1650 +1870 <-> 1057, 1380, 1426, 1846 +1871 <-> 1334 +1872 <-> 1491, 1839, 1959 +1873 <-> 1848 +1874 <-> 284, 387, 485 +1875 <-> 1286 +1876 <-> 1876, 1908 +1877 <-> 72, 84, 1281, 1697 +1878 <-> 906, 1182 +1879 <-> 1783 +1880 <-> 234, 491, 683 +1881 <-> 41, 556 +1882 <-> 332, 1574, 1882 +1883 <-> 1883 +1884 <-> 1290 +1885 <-> 853 +1886 <-> 95, 644, 934 +1887 <-> 1263, 1666 +1888 <-> 1888 +1889 <-> 855, 915, 1585 +1890 <-> 799 +1891 <-> 990, 1896 +1892 <-> 1032, 1564 +1893 <-> 267, 581 +1894 <-> 205, 953 +1895 <-> 1164, 1895 +1896 <-> 1891 +1897 <-> 963 +1898 <-> 1808, 1915 +1899 <-> 93, 689, 850 +1900 <-> 28, 168 +1901 <-> 1052 +1902 <-> 1396, 1902 +1903 <-> 695 +1904 <-> 69, 115, 195, 836, 1070, 1393 +1905 <-> 100, 247, 1054 +1906 <-> 1705, 1971 +1907 <-> 1566, 1934 +1908 <-> 765, 1876 +1909 <-> 651, 1703 +1910 <-> 1437, 1813 +1911 <-> 472, 488, 594, 734 +1912 <-> 1279, 1302 +1913 <-> 834, 1089 +1914 <-> 1327 +1915 <-> 1898 +1916 <-> 547 +1917 <-> 1548 +1918 <-> 1228, 1519 +1919 <-> 55, 1277 +1920 <-> 461, 1675 +1921 <-> 674 +1922 <-> 1001, 1922 +1923 <-> 671, 908, 1923 +1924 <-> 1391, 1614, 1958 +1925 <-> 1334 +1926 <-> 54, 625, 1461 +1927 <-> 559, 935, 1684 +1928 <-> 287, 600, 780 +1929 <-> 107, 534 +1930 <-> 139, 889, 1033 +1931 <-> 924, 1644 +1932 <-> 1038 +1933 <-> 1933 +1934 <-> 1907 +1935 <-> 712, 1464, 1633, 1730 +1936 <-> 1049, 1625 +1937 <-> 620, 1012 +1938 <-> 1669, 1938 +1939 <-> 1269, 1506 +1940 <-> 229, 918, 1076 +1941 <-> 19, 181 +1942 <-> 67 +1943 <-> 1426, 1651 +1944 <-> 218, 391 +1945 <-> 1230 +1946 <-> 613 +1947 <-> 983, 1648 +1948 <-> 1170, 1527 +1949 <-> 91 +1950 <-> 1685 +1951 <-> 52 +1952 <-> 1481, 1952 +1953 <-> 674, 1124, 1138, 1815 +1954 <-> 12 +1955 <-> 734 +1956 <-> 1134, 1956 +1957 <-> 530, 1576, 1822 +1958 <-> 90, 632, 888, 1924 +1959 <-> 1290, 1872 +1960 <-> 848, 949 +1961 <-> 130, 1605 +1962 <-> 289 +1963 <-> 1625 +1964 <-> 1782 +1965 <-> 7 +1966 <-> 685 +1967 <-> 39, 723, 1666 +1968 <-> 525 +1969 <-> 1042 +1970 <-> 579, 977, 1654 +1971 <-> 1178, 1906 +1972 <-> 1847 +1973 <-> 645, 1806 +1974 <-> 350, 446 +1975 <-> 259, 1432 +1976 <-> 1063 +1977 <-> 236, 1860 +1978 <-> 954, 1290 +1979 <-> 967, 1604 +1980 <-> 940, 1314 +1981 <-> 1472 +1982 <-> 1277 +1983 <-> 217, 540, 1588 +1984 <-> 560, 892, 1483 +1985 <-> 327, 1072 +1986 <-> 581 +1987 <-> 437, 1655, 1809 +1988 <-> 954, 1034 +1989 <-> 532, 1003, 1731 +1990 <-> 300, 1151 +1991 <-> 1349, 1674 +1992 <-> 614 +1993 <-> 87, 581, 1471 +1994 <-> 778, 1119 +1995 <-> 1293 +1996 <-> 198, 323 +1997 <-> 1853 +1998 <-> 1042, 1127, 1291, 1568 +1999 <-> 433, 1714 diff --git a/2017/day/12/problem.txt b/2017/day/12/problem.txt new file mode 100644 index 0000000..3f22692 --- /dev/null +++ b/2017/day/12/problem.txt @@ -0,0 +1,34 @@ +--- Day 12: Digital Plumber --- + +Walking along the memory banks of the stream, you find a small village that is experiencing a little confusion: some programs can't communicate with each other. + +Programs in this village communicate using a fixed system of pipes. Messages are passed between programs using these pipes, but most programs aren't connected to each other directly. Instead, programs pass messages between each other until the message reaches the intended recipient. + +For some reason, though, some of these messages aren't ever reaching their intended recipient, and the programs suspect that some pipes are missing. They would like you to investigate. + +You walk through the village and record the ID of each program and the IDs with which it can communicate directly (your puzzle input). Each program has one or more programs with which it can communicate, and these pipes are bidirectional; if 8 says it can communicate with 11, then 11 will say it can communicate with 8. + +You need to figure out how many programs are in the group that contains program ID 0. + +For example, suppose you go door-to-door like a travelling salesman and record the following list: + +0 <-> 2 +1 <-> 1 +2 <-> 0, 3, 4 +3 <-> 2, 4 +4 <-> 2, 3, 6 +5 <-> 6 +6 <-> 4, 5 + +In this example, the following programs are in the group that contains program ID 0: + + Program 0 by definition. + Program 2, directly connected to program 0. + Program 3 via program 2. + Program 4 via program 2. + Program 5 via programs 6, then 4, then 2. + Program 6 via programs 4, then 2. + +Therefore, a total of 6 programs are in this group; all but program 1, which has a pipe that connects it to itself. + +How many programs are in the group that contains program ID 0? diff --git a/2017/day/12/src/main.rs b/2017/day/12/src/main.rs new file mode 100644 index 0000000..09122ba --- /dev/null +++ b/2017/day/12/src/main.rs @@ -0,0 +1,43 @@ +use std::io::Read; +use std::fs::File; +use std::str::FromStr; +use std::collections::HashSet; + +fn main() { + let mut buffer = String::new(); + let mut file = File::open("input").expect("unable to open input file"); + file.read_to_string(&mut buffer).expect("error reading input"); + + let mut programs = Vec::new(); + + for line in buffer.lines() { + // 1 <-> 66, 1682 + let parts: Vec<&str> = line.split(" <-> ").collect(); + let _pid = usize::from_str(parts[0]).unwrap(); + let linked: Vec = parts[1].split(", ").map(|id| usize::from_str(id).unwrap()).collect(); + + // Assumes input is a sequential list of program ids with no gaps + programs.push(linked); + } + + println!("{}", reachable(&programs)); +} + +fn reachable(list: &Vec>) -> usize { + let mut visited = HashSet::new(); + + visit(0, &mut visited, list); + + visited.len() +} + +fn visit(pid: usize, visited: &mut HashSet, list: &Vec>) { + if visited.contains(&pid) { + return + } + + visited.insert(pid); + for child in list[pid].iter() { + visit(*child, visited, list); + } +}