summaryrefslogtreecommitdiff
path: root/day09
diff options
context:
space:
mode:
Diffstat (limited to 'day09')
-rw-r--r--day09/day09.java77
-rw-r--r--day09/input200
-rw-r--r--day09/test3
3 files changed, 280 insertions, 0 deletions
diff --git a/day09/day09.java b/day09/day09.java
new file mode 100644
index 0000000..4609508
--- /dev/null
+++ b/day09/day09.java
@@ -0,0 +1,77 @@
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.Arrays;
+import java.util.ArrayList;
+
+public class day09 {
+ public static void main(String args[]) throws IOException {
+ RandomAccessFile input = new RandomAccessFile("input", "r");
+ System.out.println("Day 09 Part 1: " + part1(input));
+ input.seek(0);
+ System.out.println("Day 09 Part 2: " + part2(input));
+ input.close();
+ }
+
+ public static String part1(RandomAccessFile input) throws IOException {
+ String line;
+ int sum = 0;
+ while ((line = input.readLine()) != null) {
+ String[] linea = line.split(" ");
+ int[] nums = new int[linea.length];
+ for (int i = 0; i < linea.length; i++) {
+ nums[i] = Integer.parseInt(linea[i]);
+ }
+
+ sum += predictNext(nums);
+ }
+ return Integer.toString(sum);
+ }
+
+ public static String part2(RandomAccessFile input) throws IOException {
+ return "WIP";
+ }
+
+ private static int predictNext(int[] line) {
+ ArrayList<ArrayList<Integer>> differences = new ArrayList<>();
+ ArrayList<Integer> lastDiffs = new ArrayList<>();
+
+ for (int i: line) {
+ lastDiffs.add(i);
+ }
+
+ differences.add(lastDiffs);
+
+ while (!allZero(lastDiffs)) {
+ lastDiffs = getDifferences(lastDiffs);
+ differences.add(lastDiffs);
+ }
+
+ for (int i = differences.size() - 2; i >= 0; i--) {
+ ArrayList<Integer> lastrow = differences.get(i+1);
+ ArrayList<Integer> row = differences.get(i);
+ row.add(row.get(row.size() - 1) + lastrow.get(lastrow.size() - 1));
+ }
+
+ ArrayList<Integer> first = differences.get(0);
+ return first.get(first.size() - 1);
+ }
+
+ private static boolean allZero(ArrayList<Integer> list) {
+ for(int i: list) {
+ if (i != 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static ArrayList<Integer> getDifferences(ArrayList<Integer> last) {
+ ArrayList<Integer> next = new ArrayList<>();
+
+ for (int i = 1; i < last.size(); i++) {
+ next.add(last.get(i) - last.get(i-1));
+ }
+
+ return next;
+ }
+}
diff --git a/day09/input b/day09/input
new file mode 100644
index 0000000..713a244
--- /dev/null
+++ b/day09/input
@@ -0,0 +1,200 @@
+17 23 29 35 41 47 53 59 65 71 77 83 89 95 101 107 113 119 125 131 137
+22 45 86 154 265 445 733 1184 1872 2893 4368 6446 9307 13165 18271 24916 33434 44205 57658 74274 94589
+6 16 30 64 149 347 782 1686 3460 6750 12538 22248 37867 62081 98426 151454 226914 331948 475302 667552 921345
+13 26 52 98 178 318 561 972 1643 2698 4298 6646 9992 14638 20943 29328 40281 54362 72208 94538 122158
+14 19 28 40 55 74 99 133 180 245 334 454 613 820 1085 1419 1834 2343 2960 3700 4579
+2 -2 -2 7 44 166 512 1375 3320 7387 15464 31029 60732 117883 230123 455904 918822 1876972 3859134 7925415 16154444
+5 19 52 120 243 454 822 1489 2721 4973 8968 15790 26991 44712 71818 112047 170173 252183 365468 519028 723691
+17 22 22 10 -13 -25 30 255 813 1940 3958 7288 12463 20141 31118 46341 66921 94146 129494 174646 231499
+5 21 40 70 145 354 885 2086 4545 9201 17534 31968 56807 100419 180203 333505 640725 1272353 2581012 5274766 10731677
+0 9 34 83 166 301 520 875 1444 2337 3702 5731 8666 12805 18508 26203 36392 49657 66666 88179 115054
+-4 -12 -14 -3 36 142 412 1069 2595 5982 13178 27833 56502 110595 209704 387729 704906 1272140 2300122 4196317 7750620
+5 25 74 175 365 710 1341 2526 4791 9100 17111 31560 56925 100770 176744 311473 560217 1041391 2009952 4007637 8159461
+6 3 12 50 138 300 565 977 1618 2646 4344 7167 11762 18921 29409 43588 60734 77917 88284 78552 25482
+17 27 40 62 101 176 345 774 1898 4784 11925 28924 67941 154472 340149 726046 1503981 3028703 5944196 11407788 21496171
+9 17 26 30 19 -20 -93 -173 -138 386 2429 8668 25682 68701 170928 400751 891895 1893911 3853492 7541090 14242341
+2 13 33 66 116 187 283 408 566 761 997 1278 1608 1991 2431 2932 3498 4133 4841 5626 6492
+19 33 47 61 75 89 103 117 131 145 159 173 187 201 215 229 243 257 271 285 299
+10 7 4 1 -2 -5 -8 -11 -14 -17 -20 -23 -26 -29 -32 -35 -38 -41 -44 -47 -50
+7 21 58 136 277 505 859 1431 2446 4418 8443 16727 33494 66476 129254 244796 450625 806147 1402776 2377610 3931539
+6 12 18 32 73 189 497 1266 3091 7259 16506 36530 78880 166198 341258 681851 1324432 2500993 4597049 8246956 14503073
+0 19 65 147 278 493 890 1702 3407 6892 13719 26628 50615 95346 180483 346988 680098 1354169 2717129 5444621 10813660
+18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98 103 108 113 118
+4 11 27 59 121 252 557 1283 2950 6580 14109 29132 58223 113195 214823 398750 724536 1289097 2246119 3833425 6410725
+20 33 61 125 256 494 898 1580 2787 5081 9709 19306 39114 78905 155775 298050 551082 987533 1729409 2999303 5238352
+16 37 64 92 129 217 460 1059 2354 4873 9388 16978 29099 47661 75112 114529 169716 245309 346888 481096 655765
+1 -2 4 37 129 329 706 1352 2385 3952 6232 9439 13825 19683 27350 37210 49697 65298 84556 108073 136513
+15 34 66 110 162 212 241 218 97 -186 -716 -1602 -2980 -5016 -7909 -11894 -17245 -24278 -33354 -44882 -59322
+1 -4 -9 -14 -19 -24 -29 -34 -39 -44 -49 -54 -59 -64 -69 -74 -79 -84 -89 -94 -99
+26 42 60 81 106 136 172 215 266 326 396 477 570 676 796 931 1082 1250 1436 1641 1866
+-1 0 17 75 222 536 1128 2144 3783 6369 10552 17796 31505 59564 119963 252961 546723 1189914 2576707 5510873 11592052
+10 8 18 68 212 544 1228 2553 5031 9578 17861 32975 60759 112304 208593 388796 724584 1343996 2469972 4480742 8001934
+17 24 33 53 115 289 707 1592 3293 6326 11421 19575 32111 50743 77647 115538 167753 238340 332153 454953 613515
+-2 4 27 77 164 298 489 747 1082 1504 2023 2649 3392 4262 5269 6423 7734 9212 10867 12709 14748
+9 27 66 147 316 657 1305 2459 4395 7479 12180 19083 28902 42493 60867 85203 116861 157395 208566 272355 350976
+14 22 25 19 1 -14 43 355 1308 3614 8473 17779 34375 62362 107467 177475 282730 436710 656681 964435 1387117
+-3 -5 -3 20 95 266 584 1097 1842 2866 4360 7117 13785 31901 80693 205533 507379 1200537 2721899 5929954 12453659
+-2 -6 -10 -2 45 185 529 1308 2999 6575 14004 29260 60413 124017 254338 522485 1075032 2209420 4515942 9135654 18213033
+0 2 10 24 44 70 102 140 184 234 290 352 420 494 574 660 752 850 954 1064 1180
+15 35 68 123 212 358 619 1145 2311 5005 11196 24969 54303 114010 230525 449855 851501 1574793 2872406 5223913 9579436
+1 12 26 45 77 143 285 575 1136 2201 4251 8288 16324 32228 63218 122590 234851 445418 838656 1570503 2925575
+12 18 30 52 79 98 101 126 367 1439 4957 14697 38752 93259 208409 437484 869486 1645408 2977228 5167214 8623149
+2 9 27 76 189 421 872 1743 3455 6878 13745 27380 53998 105155 202662 388814 747728 1448827 2832311 5570536 10960843
+6 21 52 116 242 471 856 1462 2366 3657 5436 7816 10922 14891 19872 26026 33526 42557 53316 66012 80866
+27 46 72 105 145 192 246 307 375 450 532 621 717 820 930 1047 1171 1302 1440 1585 1737
+18 27 47 88 156 253 377 522 678 831 963 1052 1072 993 781 398 -198 -1053 -2217 -3744 -5692
+1 -2 11 51 123 227 375 636 1221 2620 5803 12497 25551 49401 90647 158754 266889 432906 680491 1040479 1552355
+11 19 53 139 324 695 1404 2690 4884 8393 13702 21537 33548 54291 96075 189685 406620 903237 2005712 4369783 9275287
+6 26 54 84 101 91 78 210 933 3316 9620 24239 55180 116291 230490 434293 783984 1363814 2296658 3757598 5990935
+17 32 55 82 103 101 51 -81 -339 -778 -1465 -2480 -3917 -5885 -8509 -11931 -16311 -21828 -28681 -37090 -47297
+8 19 46 94 178 332 625 1196 2329 4613 9283 18937 39006 80673 166478 340764 688748 1371109 2687294 5193886 9931528
+18 35 71 144 282 526 938 1614 2702 4425 7109 11216 17382 26460 39568 58142 83994 119375 167043 230336 313250
+14 40 90 173 307 532 925 1617 2812 4808 8020 13005 20489 31396 46879 68353 97530 136456 187550 253645 338031
+3 16 43 94 187 348 611 1018 1619 2472 3643 5206 7243 9844 13107 17138 22051 27968 35019 43342 53083
+5 28 81 186 386 772 1534 3044 5982 11525 21644 39625 71108 126327 224994 406631 751431 1420338 2728511 5274348 10157618
+18 29 39 48 56 63 69 74 78 81 83 84 84 83 81 78 74 69 63 56 48
+12 37 73 120 178 247 327 418 520 633 757 892 1038 1195 1363 1542 1732 1933 2145 2368 2602
+10 24 39 55 83 165 400 973 2188 4526 8797 16543 30989 59043 115126 227981 452078 885812 1699395 3176183 5772167
+27 39 51 63 75 87 99 111 123 135 147 159 171 183 195 207 219 231 243 255 267
+19 32 57 98 160 249 372 537 753 1030 1379 1812 2342 2983 3750 4659 5727 6972 8413 10070 11964
+20 46 95 192 375 701 1270 2277 4103 7458 13592 24594 43804 76369 129981 215843 349918 554526 860365 1309044 1956229
+7 15 32 58 93 137 190 252 323 403 492 590 697 813 938 1072 1215 1367 1528 1698 1877
+22 27 24 8 -26 -83 -168 -286 -442 -641 -888 -1188 -1546 -1967 -2456 -3018 -3658 -4381 -5192 -6096 -7098
+1 13 37 84 190 427 922 1903 3813 7581 15232 31175 64744 134904 278554 564835 1119995 2172224 4136399 7779931 14550840
+3 -3 -5 -1 3 -11 -77 -249 -605 -1251 -2325 -4001 -6493 -10059 -15005 -21689 -30525 -41987 -56613 -75009 -97853
+4 7 26 69 154 330 718 1593 3539 7723 16362 33522 66525 128496 243016 452530 833174 1520127 2749570 4925963 8726764
+8 29 64 114 194 344 651 1293 2620 5302 10615 21036 41543 82489 165853 338411 698444 1447779 2989326 6103302 12254972
+22 36 69 131 230 387 670 1264 2616 5730 12739 27959 59764 123885 249292 488988 940418 1784784 3362993 6320771 11880394
+21 47 99 193 357 648 1187 2220 4214 8013 15122 28278 52650 98378 185911 357147 698552 1388925 2797665 5686094 11618262
+-3 2 8 7 -12 -53 -86 17 626 2654 8137 21271 50151 109535 225045 439317 820723 1475410 2563534 4320711 7085862
+18 35 75 152 277 454 676 921 1148 1293 1265 942 167 -1256 -3566 -7049 -12042 -18937 -28185 -40300 -55863
+-4 8 40 106 229 459 915 1858 3810 7754 15482 30210 57672 108080 199675 365269 664576 1208084 2204432 4056002 7552679
+5 23 46 86 182 412 905 1853 3523 6269 10544 16912 26060 38810 56131 79151 109169 147667 196322 257018 331858
+8 23 50 99 198 407 839 1700 3377 6633 13018 25692 51015 101557 201740 398365 780230 1514838 2917948 5588250 10675192
+1 1 17 72 196 420 778 1342 2341 4449 9362 20820 46294 99733 206229 410527 793497 1504773 2826863 5297676 9936640
+22 44 74 112 158 212 274 344 422 508 602 704 814 932 1058 1192 1334 1484 1642 1808 1982
+4 15 35 57 78 105 176 424 1223 3479 9177 22381 51032 110140 227385 452825 875490 1651299 3049203 5526021 9845454
+7 6 16 63 200 520 1170 2366 4409 7702 12768 20269 31026 46040 66514 93876 129803 176246 235456 310011 402844
+10 10 21 62 160 359 752 1543 3142 6302 12337 23536 44058 81958 153747 294390 578600 1165163 2387973 4942081 10263734
+22 44 87 162 281 449 666 964 1523 2945 6839 17020 41901 99121 224177 485897 1013096 2038798 3971091 7503122 13779053
+2 5 8 26 98 294 715 1496 2838 5125 9239 17293 34213 71040 151758 327411 705240 1508339 3196082 6703012 13904414
+15 18 25 48 104 218 427 796 1474 2855 5978 13417 31103 71821 161571 350580 731433 1467336 2833459 5272762 9463234
+4 19 46 96 204 435 891 1735 3257 6016 11114 20726 39196 75454 148464 299291 616814 1290049 2709802 5657748 11644416
+22 45 93 174 297 472 707 998 1309 1553 1631 1702 3113 10941 40131 129249 369950 968563 2373075 5532556 12421751
+8 27 66 139 284 587 1211 2423 4608 8261 13964 22389 34428 51677 77817 122237 209157 399782 844079 1897234 4372269
+2 -3 -8 -13 -18 -23 -28 -33 -38 -43 -48 -53 -58 -63 -68 -73 -78 -83 -88 -93 -98
+3 23 68 150 279 469 764 1296 2394 4786 9986 21046 43990 90444 182244 359154 691269 1298225 2378000 4248878 7409073
+21 31 40 39 23 4 28 196 689 1797 3952 7765 14067 23954 38836 60490 91117 133403 190584 266515 365743
+1 9 26 53 91 141 204 281 373 481 606 749 911 1093 1296 1521 1769 2041 2338 2661 3011
+3 13 44 118 278 607 1264 2540 4936 9274 16894 30117 53463 96763 182535 362151 748889 1581615 3341516 6957328 14153740
+14 25 43 61 76 108 228 592 1471 3264 6486 11735 19655 30915 46201 66148 90996 119507 146293 156137 113094
+11 26 46 72 101 132 178 283 556 1259 3030 7400 17898 42261 96616 213025 452537 926936 1833782 3511192 6521187
+7 15 33 68 128 233 449 970 2286 5504 12962 29446 64691 138614 292230 609995 1264257 2600837 5298303 10654732 21088058
+17 27 41 60 81 111 206 546 1553 4058 9536 20481 41139 79149 149307 281882 539977 1053745 2084363 4138198 8162389
+1 12 44 109 237 491 982 1884 3449 6022 10056 16127 24949 37389 54482 77446 107697 146864 196804 259617 337661
+21 39 84 172 319 542 865 1343 2126 3608 6764 13893 30172 66696 146064 312187 647171 1300657 2542576 4862254 9161421
+24 45 84 152 275 518 1032 2133 4432 9070 18181 35812 69661 134123 255222 478038 877280 1571963 2746310 4682156 7815239
+10 15 34 67 122 224 431 866 1778 3669 7582 15751 32982 69378 145355 300334 607050 1194107 2280242 4224755 7599730
+9 30 58 87 118 181 382 997 2657 6708 15904 35736 76986 160637 327240 654478 1289297 2505010 4799742 9061109 16833878
+15 33 56 84 117 155 198 246 299 357 420 488 561 639 722 810 903 1001 1104 1212 1325
+16 36 78 152 265 414 589 812 1257 2527 6208 15887 38943 89664 194724 402948 802850 1553986 2942158 5474486 10039009
+21 39 77 150 276 476 783 1274 2157 3981 8105 17679 39588 88167 192202 408225 846309 1721271 3455697 6887236 13680628
+18 32 45 65 109 203 382 690 1180 1914 2963 4407 6335 8845 12044 16048 20982 26980 34185 42749 52833
+7 16 25 34 43 52 61 70 79 88 97 106 115 124 133 142 151 160 169 178 187
+10 33 73 150 297 571 1079 2027 3803 7116 13238 24442 44809 81712 148508 269346 487703 881774 1593434 2886205 5268220
+12 26 50 98 190 355 647 1186 2246 4439 9110 19194 41032 88048 187811 394912 813352 1633848 3193714 6069866 11219146
+16 42 96 193 358 632 1089 1873 3273 5891 11041 21669 44342 93285 198169 418573 870082 1770328 3518634 6831257 12966858
+2 -3 -15 -30 -38 -22 42 187 479 1111 2654 6602 16409 39288 89125 190955 387552 748801 1384647 2462554 4230556
+-1 -1 5 39 145 398 913 1854 3443 5969 9797 15377 23253 34072 48593 67696 92391 123827 163301 212267 272345
+6 13 17 30 93 298 831 2054 4646 9822 19645 37439 68301 119697 202111 329697 520862 798683 1191033 1730260 2452229
+12 22 41 69 112 185 325 626 1322 2965 6777 15312 33686 71926 149699 306313 622368 1266376 2592641 5339639 11016868
+0 6 12 25 68 199 538 1302 2847 5710 10633 18535 30377 46839 67697 90752 110122 113662 79226 -30571 -275494
+19 40 84 156 259 390 540 702 885 1137 1621 2899 6794 18546 51477 136067 336307 777650 1693274 3499534 6918833
+14 32 71 152 306 568 964 1486 2054 2472 2397 1356 -1134 -5264 -10342 -13774 -9442 14736 80323 223264 500530
+8 21 35 46 50 43 21 -20 -84 -175 -297 -454 -650 -889 -1175 -1512 -1904 -2355 -2869 -3450 -4102
+3 19 57 137 292 578 1084 1938 3302 5343 8158 11619 15089 16942 13799 -632 -37251 -113965 -258993 -515315 -946542
+7 17 32 52 77 107 142 182 227 277 332 392 457 527 602 682 767 857 952 1052 1157
+2 3 12 34 79 176 410 991 2354 5278 11004 21343 38850 67447 114748 199478 372134 766821 1721100 4035336 9503765
+13 31 77 167 318 561 968 1689 2990 5278 9094 15050 23681 35178 48963 63062 73227 71753 45931 -23927 -166960
+7 4 5 17 47 104 201 357 599 964 1501 2273 3359 4856 6881 9573 13095 17636 23413 30673 39695
+18 40 87 172 308 508 785 1152 1622 2208 2923 3780 4792 5972 7333 8888 10650 12632 14847 17308 20028
+24 32 48 80 143 276 573 1235 2649 5496 10883 20484 36662 62528 101874 158895 237590 340704 468042 613952 763737
+18 31 49 67 79 88 139 403 1360 4164 11342 28108 64792 141223 294388 591331 1150093 2172745 3997176 7181391 12654316
+18 24 26 25 34 99 334 985 2553 6026 13311 28056 57283 114752 227990 452911 903827 1814216 3658500 7394438 14943201
+22 32 45 67 121 254 536 1045 1841 2960 4515 7085 12716 27062 63472 150195 342344 740848 1521345 2976847 5579059
+20 31 38 43 54 100 274 814 2244 5627 13043 28528 59963 122930 248648 500319 1006528 2028375 4091336 8237337 16492848
+-4 9 50 130 254 414 592 785 1069 1733 3538 8190 19153 42943 90978 181798 342818 609429 1016762 1575134 2213224
+0 1 16 71 219 555 1238 2523 4810 8742 15451 27189 48827 91104 177113 354383 716124 1436823 2829498 5434627 10154171
+4 3 10 34 96 243 562 1194 2348 4315 7482 12346 19528 29787 44034 63346 88980 122387 165226 219378 286960
+0 11 43 121 295 665 1433 2991 6051 11820 22220 40150 69784 116896 189200 296690 451962 670497 970881 1374935 1907725
+20 24 25 30 50 106 254 652 1717 4464 11195 26847 61581 135715 289067 598533 1211014 2405253 4709332 9128038 17590946
+-5 -2 5 16 31 50 73 100 131 166 205 248 295 346 401 460 523 590 661 736 815
+4 21 55 114 209 360 617 1110 2149 4402 9187 18930 37878 73233 137015 249200 443050 774099 1335031 2279738 3861239
+1 16 42 94 216 509 1172 2556 5231 10066 18322 31758 52750 84423 130796 196940 289149 415124 584170 807406 1097988
+-3 -3 7 43 131 313 653 1243 2209 3717 5979 9259 13879 20225 28753 39995 54565 73165 96591 125739 161611
+23 26 21 6 -15 -16 78 429 1335 3290 7055 13740 24897 42624 69680 109611 166887 247050 356873 504530 699777
+9 25 67 160 355 740 1452 2692 4751 8067 13348 21814 35642 58771 98396 167843 292201 519257 940125 1726672 3196585
+-3 -7 -11 -2 46 172 428 879 1603 2691 4247 6388 9244 12958 17686 23597 30873 39709 50313 62906 77722
+11 23 35 50 68 82 88 122 332 1083 3078 7458 15819 30054 51893 81974 118233 153351 170941 140098 7870
+8 13 21 28 40 84 224 601 1531 3710 8590 19005 40141 80959 156195 289076 514906 885691 1475987 2390170 3771342
+2 9 28 59 102 157 224 303 394 497 612 739 878 1029 1192 1367 1554 1753 1964 2187 2422
+21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157 165 173 181
+13 38 88 175 311 508 778 1133 1585 2146 2828 3643 4603 5720 7006 8473 10133 11998 14080 16391 18943
+19 28 43 81 169 356 735 1479 2904 5581 10525 19489 35382 62809 108695 182901 298665 472602 723871 1071961 1532359
+-4 0 14 39 76 126 190 269 364 476 606 755 924 1114 1326 1561 1820 2104 2414 2751 3116
+14 17 25 48 96 179 307 490 738 1061 1469 1972 2580 3303 4151 5134 6262 7545 8993 10616 12424
+14 30 57 106 203 401 803 1606 3175 6147 11551 20925 36457 61379 101424 169532 298864 574648 1205041 2667272 5990787
+16 22 43 91 177 324 601 1195 2553 5660 12588 27583 59202 124456 256706 520465 1038795 2043668 3968448 7618199 14484292
+14 26 46 92 196 404 776 1386 2322 3686 5594 8176 11576 15952 21476 28334 36726 46866 58982 73316 90124
+12 15 26 69 184 428 870 1587 2675 4304 6884 11498 20945 42088 90802 201755 446614 966105 2023678 4091263 7980566
+12 23 49 103 201 362 608 964 1458 2121 2987 4093 5479 7188 9266 11762 14728 18219 22293 27011 32437
+1 4 8 22 67 188 475 1092 2313 4555 8385 14476 23521 36219 53668 78892 120857 203270 381790 775106 1617759
+8 17 52 138 324 710 1487 2990 5764 10643 18842 32062 52608 83520 128717 193154 282992 405781 570656 788546 1072396
+9 27 49 82 150 313 710 1645 3747 8257 17547 36098 72422 142912 279519 544810 1061019 2065577 4017263 7800516 15121956
+-3 4 23 63 141 292 604 1301 2913 6596 14700 31731 65924 131776 254180 475479 868333 1560936 2789544 5012596 9164217
+24 37 47 55 68 108 223 507 1158 2649 6179 14751 35579 85223 200183 458131 1019280 2204737 4640799 9517599 19041058
+15 33 74 154 300 569 1084 2101 4148 8319 16863 34280 69223 137607 267443 506047 930421 1661765 2885256 4876422 8035646
+18 24 41 78 144 248 399 606 878 1224 1653 2174 2796 3528 4379 5358 6474 7736 9153 10734 12488
+11 3 -11 -28 -27 42 267 781 1767 3461 6153 10186 15953 23892 34479 48219 65635 87255 113597 145152 182365
+8 7 6 8 20 68 238 757 2124 5299 11970 24975 49120 93025 173483 325584 625368 1238475 2520546 5216762 10844580
+-3 13 51 114 200 297 372 353 103 -615 -2183 -5184 -10470 -19243 -33150 -54393 -85855 -131243 -195249 -283730 -403908
+9 26 50 84 131 194 276 380 509 666 854 1076 1335 1634 1976 2364 2801 3290 3834 4436 5099
+-9 -5 16 65 159 327 618 1124 2052 3908 7902 16775 36448 79304 170698 361676 753181 1540633 3093196 6089909 11745909
+7 19 61 163 378 798 1583 3013 5577 10129 18193 32637 59254 110449 213515 428383 884151 1851800 3885415 8091898 16641074
+18 28 38 48 58 68 78 88 98 108 118 128 138 148 158 168 178 188 198 208 218
+3 7 13 26 52 104 228 555 1380 3263 7139 14413 27001 47258 77708 120458 176137 242151 309985 361212 361786
+13 36 66 100 141 204 322 552 981 1732 2970 4908 7813 12012 17898 25936 36669 50724 68818 91764 120477
+-6 -5 14 74 206 451 862 1504 2462 3896 6232 10649 20104 41200 87197 182367 367824 709453 1311016 2342884 4114616
+11 20 56 137 284 521 875 1376 2057 2954 4106 5555 7346 9527 12149 15266 18935 23216 28172 33869 40376
+19 42 78 142 275 558 1126 2182 4011 6994 11622 18510 28411 42230 61038 86086 118819 160890 214174 280782 363075
+19 39 67 107 181 348 723 1500 3006 5848 11264 21858 42998 85299 168818 329877 631829 1181621 2154721 3831901 6652547
+23 49 90 142 210 324 570 1155 2531 5608 12089 24960 49164 92479 166605 288443 481519 777467 1217436 1853226 2747886
+25 42 62 85 111 140 172 207 245 286 330 377 427 480 536 595 657 722 790 861 935
+23 36 49 62 75 88 101 114 127 140 153 166 179 192 205 218 231 244 257 270 283
+9 9 7 5 11 44 139 352 765 1491 2679 4519 7247 11150 16571 23914 33649 46317 62535 83001 108499
+-4 2 11 23 42 88 228 634 1689 4196 9813 21951 47538 100265 206169 412631 802006 1511058 2757011 4870171 8331502
+6 9 24 73 193 436 869 1574 2648 4203 6366 9279 13099 17998 24163 31796 41114 52349 65748 81573 100101
+-2 -7 -22 -52 -102 -177 -282 -422 -602 -827 -1102 -1432 -1822 -2277 -2802 -3402 -4082 -4847 -5702 -6652 -7702
+20 33 41 40 33 46 165 608 1852 4846 11357 24517 49665 95609 176469 314303 542764 912087 1495761 2399302 3771609
+6 7 23 76 206 493 1108 2413 5136 10665 21550 42392 81454 153575 285331 523897 951754 1710291 3036513 5318524 9177254
+1 12 37 90 213 486 1037 2059 3858 6986 12556 22892 42736 81316 155674 295761 551927 1005568 1783839 3079502 5177151
+5 25 71 161 334 661 1255 2281 3961 6559 10320 15330 21268 27045 30380 27462 13005 -18763 -71307 -139873 -200558
+29 56 97 157 243 367 551 834 1287 2065 3588 7085 16017 39406 98960 243262 574393 1295446 2791779 5764933 11446359
+12 30 61 112 203 382 744 1464 2874 5646 11187 22415 45187 90830 180548 353037 677568 1276270 2361585 4298154 7703067
+6 18 26 25 10 -24 -82 -169 -290 -450 -654 -907 -1214 -1580 -2010 -2509 -3082 -3734 -4470 -5295 -6214
+13 21 42 104 255 572 1178 2277 4224 7655 13711 24400 43152 75634 130905 223005 373087 612217 984984 1554080 2406029
+12 27 47 77 135 276 628 1453 3267 7077 14816 30075 59240 113138 209275 374707 649518 1090783 1776765 2810929 4325149
+-4 -14 -29 -54 -84 -88 8 339 1120 2666 5413 9940 16992 27504 42626 63749 92532 130930 181223 246046 328420
+22 45 86 167 329 644 1245 2395 4640 9142 18390 37681 78120 162525 336725 690593 1396201 2775374 5416585 10372806 19489086
+11 23 43 88 179 353 696 1399 2842 5721 11258 21604 40731 76546 145867 285590 576245 1188651 2471041 5103392 10358443
+20 29 53 119 279 632 1354 2737 5244 9596 16921 29029 48977 82364 140481 248004 461295 910451 1892831 4075596 8925108
+-9 2 43 140 327 644 1137 1858 2864 4225 6077 8809 13595 23790 48469 111125 270193 665184 1615223 3819314 8744923
+14 32 65 130 255 482 877 1561 2783 5060 9404 17640 32798 59557 104783 178472 296255 487071 816374 1453001 2852008
+16 37 78 158 313 605 1129 2028 3547 6190 11089 20751 40418 80356 159482 310843 589578 1084123 1931560 3338164 5606367
+10 31 77 176 383 792 1557 2930 5321 9382 16114 26993 44108 70301 109296 165801 245564 355361 502891 696550 945053
+21 45 82 130 188 258 358 576 1217 3133 8394 21581 52207 119193 259134 541669 1098377 2177721 4250402 8212068 15772458
+9 21 34 58 119 273 632 1402 2933 5781 10782 19138 32515 53153 83988 128786 192289 280373 400218 560490 771535
+2 2 6 33 127 380 967 2193 4552 8798 16028 27777 46125 73816 114389 172321 253182 363802 512450 709025 965259
+-5 -14 -15 7 75 233 577 1312 2847 5959 12114 24163 47884 95301 191550 388672 792996 1619714 3302921 6719592 13645596
+28 49 82 138 246 470 937 1887 3767 7410 14375 27598 52670 100416 192172 370544 721018 1414547 2789936 5510598 10858378
+14 28 54 105 217 468 1006 2088 4129 7757 13867 23664 38682 60763 91977 134461 190152 260386 345332 443227 549375
diff --git a/day09/test b/day09/test
new file mode 100644
index 0000000..539a763
--- /dev/null
+++ b/day09/test
@@ -0,0 +1,3 @@
+0 3 6 9 12 15
+1 3 6 10 15 21
+10 13 16 21 30 45