From 95c3c6131aff0048b5a6bd3cbf54f70b4d534c0e Mon Sep 17 00:00:00 2001 From: mtrx Date: Wed, 4 Dec 2024 22:27:23 +0100 Subject: [PATCH] init --- .vscode/settings.json | 3 + deno.json | 8 + inputs/01.txt | 1000 +++++++++++++++++++++++++++++++++++++++++ inputs/02.txt | 1000 +++++++++++++++++++++++++++++++++++++++++ main.ts | 21 + solutions/01.ts | 40 ++ solutions/02.ts | 18 + solvable.ts | 6 + utils.ts | 5 + 9 files changed, 2101 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 deno.json create mode 100644 inputs/01.txt create mode 100644 inputs/02.txt create mode 100644 main.ts create mode 100644 solutions/01.ts create mode 100644 solutions/02.ts create mode 100644 solvable.ts create mode 100644 utils.ts diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b943dbc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "deno.enable": true +} \ No newline at end of file diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..4d40aae --- /dev/null +++ b/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "dev": "deno run --watch --allow-read=. main.ts" + }, + "imports": { + "@std/assert": "jsr:@std/assert@1" + } +} diff --git a/inputs/01.txt b/inputs/01.txt new file mode 100644 index 0000000..cb6af3c --- /dev/null +++ b/inputs/01.txt @@ -0,0 +1,1000 @@ +14764 28773 +59598 86587 +63147 83451 +40514 98156 +87534 16479 +45973 70030 +54965 61736 +74648 96398 +74806 54303 +59928 90661 +20699 66537 +78761 92340 +98940 65476 +80802 95605 +60992 14776 +50682 24755 +50058 93707 +94284 24755 +12156 11378 +12570 11246 +80932 42425 +43285 34499 +12178 60368 +42769 14776 +84125 76989 +96147 56013 +59913 97498 +96516 73501 +50544 14989 +61563 30781 +77558 24755 +42975 16439 +15144 48888 +58682 54556 +26702 28773 +70122 84904 +63011 21879 +35169 61029 +24755 17273 +82821 84904 +72828 31150 +79206 14776 +33200 20410 +60784 31612 +83670 47240 +34804 33091 +60626 38038 +86976 14776 +52742 73610 +14475 89997 +38361 86278 +13676 47791 +55862 38300 +49359 88343 +65399 50107 +37680 70002 +18748 70030 +18194 60295 +47721 87961 +88751 81703 +43668 87575 +98122 81412 +40374 59406 +10728 70002 +16342 87961 +39219 60134 +49679 38882 +60516 42195 +24012 66048 +25680 58634 +43100 28773 +25474 63592 +96520 14989 +57777 48481 +79027 93493 +11616 31094 +78378 70069 +84632 41501 +56086 13252 +42233 14000 +91310 34109 +30039 70635 +51428 33091 +74252 27409 +47188 50437 +67840 82887 +51822 38041 +61288 11754 +28673 95998 +84464 18379 +19745 14989 +76538 69263 +48693 48158 +25824 26564 +47422 26702 +63260 55162 +50610 20088 +11246 14776 +36616 96398 +48715 37866 +40501 87961 +84018 11246 +11235 95605 +60766 84099 +56833 10632 +26052 24115 +86850 63187 +96807 97498 +36028 14776 +28835 44350 +80413 14989 +23361 94328 +73994 70570 +95782 14989 +50992 96398 +16452 24559 +23476 26026 +48928 20088 +65743 30914 +23934 97498 +44641 85863 +19631 73108 +95142 58795 +98765 54626 +63049 20977 +18870 96398 +39312 32124 +19723 24115 +75131 99521 +15390 25186 +73207 10585 +14040 51560 +29954 68086 +38712 70030 +85468 86587 +95155 85042 +67412 98156 +41035 94284 +83320 48158 +90483 86587 +56827 49101 +75118 26702 +41487 57022 +46320 14776 +66537 87961 +52715 83100 +38882 26936 +70814 43122 +70750 64345 +29589 44580 +37398 26936 +40837 70002 +16771 11659 +94208 28773 +87906 97482 +74664 86587 +90116 87961 +99992 14989 +34113 81703 +89349 24115 +98148 62403 +42448 66537 +96296 28773 +57152 68961 +11277 42577 +36095 95605 +74684 28773 +33845 70570 +38158 14989 +15582 49424 +43600 11804 +63053 13761 +24342 76970 +92512 70030 +54252 30763 +73129 84904 +28773 12682 +32819 91123 +49835 86136 +16933 48639 +33213 12919 +10645 57366 +98251 65105 +52576 92477 +69406 30133 +67892 97797 +72483 26702 +17769 33091 +56789 53884 +14989 98156 +24140 97478 +18359 90471 +12073 91310 +38574 55162 +33091 74847 +89381 14213 +49449 91310 +64091 70030 +39247 42425 +25923 14989 +71251 68086 +24345 96398 +51558 79525 +96411 47119 +89958 70570 +76933 62218 +55949 70002 +43038 17285 +28551 26702 +95390 18863 +14866 46054 +88996 66537 +26075 21233 +39333 24115 +76335 97498 +99707 53061 +42177 90193 +14331 14776 +50227 38217 +78702 65884 +68910 87030 +46977 11246 +48214 96398 +51071 63952 +10391 33023 +46218 70030 +87713 79687 +57826 54282 +39480 97498 +64702 58553 +30861 51958 +22562 20088 +87627 28773 +68916 98156 +57407 88060 +29689 23857 +65454 98968 +15700 37327 +26803 95605 +15017 29068 +40380 60403 +69860 26248 +66059 88561 +58318 38541 +17839 28773 +79014 14989 +33520 24755 +81719 99646 +97850 30945 +89786 33091 +38928 38882 +93407 94284 +69408 48928 +37881 70002 +32254 43523 +68247 28773 +54752 89267 +29214 20088 +98248 98156 +58405 14989 +19932 93969 +95299 11246 +34948 70635 +35574 70002 +61738 80387 +98156 84904 +70128 66075 +44319 37979 +24280 27624 +36470 47223 +62315 42425 +32292 56201 +52245 45780 +70839 32043 +34787 78810 +67967 21147 +47767 86498 +88861 60623 +81588 82803 +57939 81703 +31732 94284 +46639 74596 +39121 76377 +10454 94284 +46701 27665 +80935 48158 +93418 99233 +86078 49136 +55356 72518 +51235 48158 +94312 89985 +18379 76636 +82631 46202 +73383 72296 +30654 74007 +82162 80836 +81614 56019 +26936 14776 +64866 64944 +10826 89173 +85362 73676 +39371 46554 +68384 28773 +87889 38587 +14856 56658 +99573 51530 +91777 78669 +95150 97498 +49111 26038 +60208 97704 +69664 24755 +27678 84904 +48916 78231 +15557 89973 +90782 20088 +87961 84904 +42368 26702 +40844 81703 +40750 66537 +13745 87961 +20088 24115 +31234 63276 +17198 25020 +67865 53558 +16266 19730 +64250 15511 +34405 95190 +69368 81775 +90053 31704 +65374 97498 +91614 69998 +70733 62921 +48158 92224 +99303 26702 +51318 20088 +24507 70570 +21139 24682 +62476 16854 +35217 94943 +38613 85127 +65794 23397 +43762 98156 +38914 26702 +93827 95605 +18121 83482 +44552 70570 +94358 70635 +44248 87279 +93340 91862 +47094 80019 +12115 22286 +61446 66475 +22034 81703 +13882 64607 +42845 56734 +14983 98703 +42881 38664 +69071 58912 +84078 87961 +77528 28773 +65018 26702 +80503 27258 +40534 98156 +97419 27317 +61450 61386 +44217 78513 +35342 55289 +60439 70002 +72059 70570 +76006 70570 +86878 40854 +58404 38860 +49034 23075 +55592 38032 +38344 16697 +53897 33091 +72649 18979 +59214 18944 +92474 69727 +56370 36522 +20573 20088 +26285 11559 +15809 43925 +56727 92121 +84539 96398 +55090 41104 +77753 83370 +78169 44330 +62175 84776 +61410 67693 +26872 94284 +80145 33677 +63895 27014 +54436 94284 +27551 52234 +70275 97498 +83218 84328 +76355 42630 +47953 29593 +40172 70635 +29988 57720 +84694 45868 +14741 84904 +78418 32122 +19787 96398 +97191 75785 +62241 14110 +38111 49908 +16878 95565 +65882 87961 +27528 30687 +24926 66537 +66319 86032 +71326 82785 +33060 79631 +80025 17963 +73714 96398 +33135 74777 +68453 48928 +97498 24115 +86671 18667 +71089 40231 +88441 26416 +69505 18247 +84654 87513 +68724 98903 +89841 28773 +56212 21616 +17426 80476 +44666 38523 +91211 26702 +26105 70635 +21759 14776 +98944 26362 +71236 38797 +42913 58775 +88578 14776 +72715 43283 +28967 20088 +84103 76725 +99695 48928 +64085 28773 +73316 33493 +72198 48928 +49559 70002 +38910 48928 +17599 42425 +84904 78946 +22276 55162 +58705 96924 +49033 55841 +57127 69408 +14022 70002 +64371 26702 +97436 54477 +30953 95848 +52677 10733 +62159 48928 +88481 55753 +81171 66537 +57638 46475 +61383 79886 +88427 24420 +96594 50213 +11462 90266 +67963 73678 +17744 66537 +79612 95605 +93100 30264 +32749 20088 +94436 75277 +45034 39394 +51810 84904 +43770 87961 +59487 84904 +73654 20088 +76244 39669 +93096 41969 +61078 18532 +64038 68086 +80823 20926 +24219 33166 +64789 47154 +45656 59480 +96245 26702 +46975 96398 +21791 21720 +36832 25932 +40413 90256 +35647 56771 +85109 69081 +96428 95605 +63398 98448 +86469 81278 +34738 54568 +58332 69690 +29366 38882 +43612 26582 +20715 13081 +13296 22608 +73338 65201 +39693 75574 +55258 87961 +72724 68868 +78654 50140 +85411 31891 +60178 64075 +67363 80960 +37379 96429 +40440 52965 +82070 48657 +22042 17036 +77928 49874 +16662 96398 +39080 72090 +36754 90110 +52253 13816 +63630 48928 +68957 70819 +45100 25633 +82085 27847 +17126 28773 +37291 97173 +57062 11246 +12567 71707 +51113 75861 +89899 26702 +99628 26702 +75520 81811 +93558 13940 +49113 62910 +20958 87961 +77841 87019 +75297 48928 +57790 48928 +32002 77033 +42282 94284 +43678 84904 +31604 49493 +74565 28773 +22599 31143 +82887 59506 +39004 54574 +78978 79120 +90292 39855 +95502 99786 +21111 70626 +56784 92396 +13139 80974 +92819 25441 +73536 87961 +29862 24755 +99684 73955 +72968 89889 +13389 24733 +11304 81703 +21283 96196 +29316 10170 +39855 52810 +87865 93597 +97638 24115 +65813 70719 +60400 31888 +28931 32564 +39635 69408 +53198 87575 +26868 87575 +76903 38317 +65814 97018 +30920 33091 +17272 86587 +36064 40874 +60497 86587 +52751 94284 +98146 20555 +82591 71240 +80940 94284 +58866 60084 +19528 96398 +50171 42425 +83139 14776 +54987 84299 +86114 91310 +95215 20088 +33676 91776 +33258 84904 +94339 14989 +93998 30882 +12128 48129 +70002 20088 +17360 55991 +53459 95355 +86002 70002 +82138 79394 +77891 97498 +97857 56980 +80792 63735 +25421 58294 +35922 12614 +81854 32809 +53275 35517 +57944 58635 +87461 63921 +18830 65741 +71991 21238 +20578 14989 +30318 93736 +47800 78875 +70513 70570 +19497 23690 +85084 95631 +22048 86587 +81414 55666 +80731 69207 +18973 59682 +94485 48928 +77316 13319 +12204 51966 +70689 33091 +34924 22911 +96610 19455 +55203 24115 +75093 48158 +87356 14999 +18221 33578 +73385 48928 +81742 58221 +99442 82887 +28678 80624 +35197 87961 +35467 94284 +18508 51523 +14264 54207 +31053 40807 +64587 56579 +31857 72079 +80498 95581 +73182 87575 +38534 55162 +19889 76201 +62987 35692 +28009 48158 +62366 13329 +67690 14228 +87575 13596 +75924 66537 +43917 48158 +85815 28141 +12195 66537 +28926 26936 +28067 11246 +10649 83782 +90300 37607 +26829 33091 +97237 61393 +28274 87961 +81949 69715 +10148 86587 +20782 82454 +65121 86587 +35048 25761 +42425 98156 +49562 26702 +62240 64020 +97292 25754 +77339 95190 +96171 69408 +78515 44047 +23269 81703 +86257 11890 +53795 31884 +47860 69457 +27030 81703 +95995 46031 +88330 14776 +36227 95605 +71611 49839 +41787 68086 +98937 95605 +15634 78884 +38019 25226 +40301 68031 +64868 55162 +20353 28773 +52004 20088 +33605 36752 +52954 97498 +22677 92974 +35007 86399 +16229 14776 +92840 67007 +53192 70030 +14342 89825 +83874 20965 +67836 23984 +13168 89395 +45532 99100 +28527 26702 +11652 24115 +65046 72711 +24115 22371 +15313 14989 +46692 26702 +55036 14776 +47509 96398 +79999 58058 +75429 27911 +86289 83776 +40994 86587 +23698 49671 +60630 70567 +39923 14340 +41480 56160 +50015 85965 +20119 27795 +54647 79989 +32724 20334 +34408 48928 +13854 58826 +75114 43950 +45654 66537 +35904 14776 +97510 94203 +94288 70002 +62816 86587 +52333 95190 +56575 33091 +16125 96398 +72085 22071 +79557 70570 +88132 51844 +13717 72028 +59557 48158 +21409 10973 +84192 80904 +55868 24115 +84432 44699 +36959 87575 +76847 55162 +22567 24115 +67194 20088 +10465 86045 +30706 90300 +90253 64531 +75677 70115 +90677 80124 +16022 37893 +35712 73458 +49005 66248 +63561 62138 +39451 26233 +23062 75780 +88457 16642 +60392 76302 +10273 86587 +21677 70570 +36650 95605 +99569 14989 +70030 94284 +17260 81703 +26866 97440 +96514 96034 +96398 85529 +28702 79102 +79651 61560 +94067 31196 +71869 73932 +57996 50145 +35350 89987 +74905 77610 +42941 11246 +87385 28773 +32235 86698 +33758 84904 +75879 56926 +22019 92584 +21649 37986 +55926 84525 +74822 21112 +37702 70635 +62444 94284 +17072 12964 +80776 14776 +86143 84904 +90967 59199 +82007 95190 +61344 94380 +23060 62759 +71836 29181 +16696 86051 +23602 70030 +61274 61768 +35327 94433 +48285 55162 +19775 18482 +79268 18379 +66437 24755 +66155 44810 +54687 47121 +47590 10505 +49604 87575 +39448 14989 +70866 91310 +40876 88016 +38356 82887 +78821 87795 +60336 84904 +95020 18379 +92719 38882 +44432 70635 +55162 20864 +20330 57239 +68086 28020 +27630 63281 +86610 69601 +11026 90977 +88395 58295 +51282 39771 +27597 95605 +92765 48928 +75775 87961 +70635 94284 +24241 87961 +61618 20088 +16337 50458 +98080 39551 +28091 48158 +65880 66493 +24832 48928 +32253 27393 +27035 41482 +34239 96262 +31294 26702 +10102 12198 +36743 78333 +23284 75787 +87169 75720 +84151 87961 +26666 79650 +89818 40672 +70570 65623 +81552 84522 +56875 78429 +15373 28773 +77993 34110 +36591 96398 +61768 42887 +71478 68504 +25433 96100 +98896 81958 +93352 28773 +43847 93400 +60150 66441 +80559 70002 +45453 60573 +11057 26011 +40296 63705 +30537 95605 +95190 10399 +58593 11246 +23634 58654 +19831 48928 +60897 52279 +98886 87961 +18897 52942 +53785 10405 +58898 24115 +58346 24755 +42098 31963 +83994 80991 +22205 55162 +74702 66537 +95807 26702 +23781 92776 +49996 66296 +72776 81703 +31849 70570 +52068 87294 +98819 59638 +32585 48158 +51597 85464 +85824 75556 +27722 57980 +71157 14989 +43341 46516 +45946 45375 +20545 48928 +73393 32160 +13910 97316 +79218 96398 +44035 88007 +15597 79600 +15662 70002 +34269 49123 +37898 98156 +40216 26702 +92831 87961 +77463 70570 +89751 84904 +56728 88267 +55828 45038 +99410 96962 +27691 22801 +10416 70570 +47279 91310 +50204 14776 +56597 40834 +77705 43023 +72403 33091 +36921 51477 +62196 36387 +39460 42518 +86502 37844 +88097 38882 +62899 57280 +63482 20088 +51582 24115 +82873 70570 +81897 84904 +70932 24115 +47617 78694 +17894 48126 +66191 20440 +11809 14989 +28873 70002 +26808 98156 +57387 79775 +54906 33091 +51853 14776 +48424 84904 +62763 27546 +73121 54587 +95605 48158 +61687 86587 +31005 97498 +78477 78372 +35623 84904 +20589 77307 +78283 40059 +94194 43725 +44078 67834 +81703 31282 +99920 59468 +22742 37828 +55795 12750 +27345 14989 +91944 45458 +30545 19535 +20030 70570 +25018 69169 +12044 13251 +91516 82887 +91683 16178 +27731 86587 +80834 21540 +56421 26695 +60139 70002 +28612 95499 +75264 11246 +64380 66537 +56560 26702 +18126 47523 +71350 31211 +25426 65619 +24228 83125 +45887 70570 +10621 11246 +89105 70570 +53390 49454 +57017 81703 +76370 94284 +60258 85023 +51705 96398 +15492 37504 +55450 96398 +65708 91167 +37078 83486 +14776 10500 +99794 86587 +50029 87365 +47006 35798 +87658 85900 +80839 90300 +88943 94078 +33451 28773 +91207 86587 +33560 48158 +80832 43682 +86587 16558 +34637 42425 +40252 22905 +94463 63284 +13247 72402 +14825 48158 +60196 91310 +45730 14776 +85407 18493 +19771 50847 +30506 24755 +32174 68086 diff --git a/inputs/02.txt b/inputs/02.txt new file mode 100644 index 0000000..7b87bb6 --- /dev/null +++ b/inputs/02.txt @@ -0,0 +1,1000 @@ +55 56 59 62 61 +68 70 71 74 75 76 78 78 +52 55 56 58 62 +73 76 79 82 84 85 87 94 +1 4 5 6 3 4 +77 80 78 80 83 81 +69 72 73 71 71 +14 15 17 18 17 21 +39 42 43 45 47 46 53 +72 73 73 74 75 +48 49 51 51 53 54 51 +39 40 41 41 43 43 +14 16 19 20 23 23 25 29 +69 70 70 73 80 +79 80 81 84 88 89 92 93 +7 10 13 17 18 16 +67 70 73 75 79 81 84 84 +81 82 84 88 89 93 +76 79 81 83 84 88 94 +71 72 73 80 82 83 +24 26 29 36 33 +69 70 72 73 76 81 81 +6 9 12 17 21 +45 46 52 55 58 59 66 +24 23 24 25 26 29 32 +45 43 45 48 49 51 50 +3 2 5 6 7 9 11 11 +27 25 26 29 31 32 33 37 +17 15 18 19 22 24 30 +69 68 71 70 72 +38 36 38 41 44 41 38 +16 14 12 15 15 +37 34 36 33 36 39 40 44 +80 77 78 81 79 86 +57 55 57 57 60 +31 29 30 30 28 +77 76 79 79 79 +75 73 74 76 76 80 +14 11 11 12 15 22 +72 69 72 74 78 80 81 +80 77 79 83 85 87 86 +32 29 33 36 37 39 41 41 +7 5 9 10 14 +18 17 20 23 24 26 30 35 +86 84 87 89 94 95 98 +32 29 30 37 39 38 +27 26 28 30 31 38 41 41 +20 18 25 27 31 +84 81 83 88 89 94 +21 21 24 27 28 31 32 +15 15 18 21 24 22 +42 42 43 46 47 47 +35 35 38 39 43 +61 61 63 65 67 74 +23 23 21 24 27 29 +8 8 6 9 10 9 +84 84 83 86 86 +67 67 69 71 73 70 74 +85 85 84 87 93 +9 9 11 14 17 17 20 +33 33 34 34 31 +65 65 68 68 71 71 +60 60 62 62 63 67 +11 11 14 14 20 +18 18 21 24 26 28 32 34 +43 43 44 47 51 52 55 52 +58 58 61 65 67 68 68 +55 55 57 61 63 67 +72 72 76 78 79 80 85 +1 1 2 9 12 13 +80 80 83 89 90 93 92 +24 24 26 33 36 38 38 +17 17 18 19 26 30 +21 21 23 26 33 34 37 44 +30 34 37 39 41 44 +24 28 30 31 32 35 38 36 +84 88 90 91 92 95 95 +60 64 67 70 73 76 79 83 +9 13 15 16 19 21 22 27 +46 50 51 52 49 50 51 53 +68 72 71 73 74 72 +14 18 16 19 21 23 24 24 +50 54 55 58 55 58 62 +76 80 82 81 82 85 88 93 +66 70 73 73 76 78 81 83 +37 41 42 42 43 45 43 +7 11 14 14 14 +5 9 11 11 12 16 +10 14 17 17 18 21 22 28 +32 36 38 42 43 +51 55 59 62 63 64 65 63 +14 18 19 20 24 27 29 29 +33 37 38 39 41 45 46 50 +74 78 82 85 88 89 96 +56 60 65 67 69 +30 34 36 38 43 42 +74 78 79 80 85 85 +75 79 86 87 89 91 93 97 +78 82 84 90 92 93 99 +65 72 75 77 80 82 +82 89 91 93 94 95 93 +49 56 59 62 62 +18 25 27 28 30 34 +46 52 54 56 57 62 +13 19 21 22 23 21 23 +26 32 29 31 32 31 +91 96 98 95 95 +47 52 54 51 53 55 58 62 +79 84 81 82 83 90 +75 82 82 83 86 +76 83 83 84 86 84 +9 14 17 17 17 +26 32 35 37 39 39 40 44 +40 45 45 46 53 +58 65 69 71 72 74 +34 40 44 46 48 45 +46 53 55 56 60 63 63 +18 25 29 30 34 +4 9 10 11 15 22 +51 56 61 63 64 67 70 +13 18 23 25 28 31 32 29 +16 21 27 28 28 +25 32 34 41 43 47 +29 34 37 44 47 50 55 +36 34 33 31 28 25 22 23 +27 25 22 21 21 +15 12 9 7 6 5 1 +47 46 45 44 37 +80 78 79 77 74 73 70 +16 13 11 8 5 2 4 6 +51 50 48 49 47 46 43 43 +21 18 19 17 15 13 9 +41 40 38 40 39 33 +9 8 6 6 5 +44 41 41 40 38 41 +99 96 93 93 93 +40 38 36 36 33 30 27 23 +27 25 24 24 22 17 +93 92 88 86 85 83 81 +49 46 45 41 38 41 +71 69 65 63 61 59 58 58 +51 50 48 44 41 40 38 34 +44 41 37 34 32 31 30 25 +14 13 8 5 4 2 +32 31 28 21 20 19 16 18 +39 36 35 32 27 26 26 +49 48 46 39 35 +56 54 53 47 40 +54 55 54 52 49 48 47 +78 79 78 75 74 73 76 +95 96 94 91 89 86 85 85 +73 74 72 70 69 65 +91 93 92 90 88 83 +81 84 83 86 84 83 +48 50 49 47 49 48 45 46 +88 90 88 87 89 87 87 +47 49 48 46 43 46 42 +47 48 47 46 48 42 +23 24 21 18 18 17 +66 67 67 65 68 +50 53 52 51 51 48 48 +89 92 92 90 89 85 +92 93 91 88 87 85 85 80 +88 91 88 86 82 80 +74 77 73 72 73 +30 32 29 26 24 20 19 19 +88 89 88 84 80 +42 44 40 38 35 34 27 +94 95 94 88 86 +18 19 17 14 7 4 5 +70 72 69 63 62 62 +28 30 28 27 26 19 17 13 +57 60 58 56 55 50 44 +68 68 66 63 61 +45 45 42 41 42 +76 76 74 71 68 68 +81 81 79 78 77 73 +98 98 96 95 92 87 +58 58 57 60 57 54 53 +92 92 89 87 89 87 86 89 +83 83 80 79 82 80 80 +52 52 50 47 45 46 43 39 +41 41 43 40 38 33 +57 57 56 53 52 52 50 49 +88 88 85 84 83 83 84 +72 72 70 67 65 65 65 +61 61 61 60 56 +61 61 58 57 55 53 53 48 +59 59 58 54 53 52 51 50 +45 45 44 43 41 37 39 +78 78 76 74 73 69 69 +86 86 82 81 79 76 73 69 +36 36 32 30 23 +24 24 23 22 21 18 11 8 +15 15 13 6 4 5 +41 41 38 33 32 32 +13 13 7 5 1 +74 74 71 68 65 60 54 +88 84 82 79 78 75 72 70 +91 87 84 81 80 79 82 +74 70 68 67 67 +58 54 53 52 48 +95 91 89 86 79 +51 47 50 49 48 45 44 +36 32 31 29 31 29 26 29 +86 82 80 81 80 77 77 +43 39 36 39 36 32 +77 73 76 74 71 68 66 60 +95 91 91 88 85 +12 8 8 6 5 7 +53 49 48 48 47 46 46 +30 26 26 25 21 +68 64 62 60 58 58 57 51 +45 41 40 36 35 34 +23 19 15 12 15 +38 34 30 27 27 +54 50 46 45 43 40 36 +37 33 29 27 24 19 +56 52 51 49 43 42 +66 62 56 55 52 49 51 +65 61 58 56 54 51 44 44 +70 66 65 62 59 56 50 46 +98 94 92 85 83 82 81 75 +52 45 43 41 39 +43 38 37 34 37 +57 51 50 49 48 47 44 44 +38 31 29 27 26 23 19 +23 16 14 12 7 +36 30 31 29 28 +12 6 8 5 8 +20 13 12 11 12 9 9 +93 86 84 83 84 82 80 76 +55 48 49 47 42 +17 11 9 6 6 3 +32 26 26 23 20 23 +89 84 83 83 83 +79 72 70 70 66 +56 49 48 48 45 40 +61 54 50 48 45 44 +24 18 16 12 11 9 10 +69 62 61 57 57 +34 28 27 23 20 19 15 +85 78 74 72 70 69 66 61 +59 53 52 51 46 44 43 42 +65 58 51 48 49 +98 91 86 83 83 +48 42 41 35 33 29 +47 41 40 37 31 28 21 +52 53 56 59 60 58 +62 63 65 66 67 67 +62 65 66 68 71 75 +42 44 46 47 48 51 53 59 +89 91 94 93 96 99 +29 32 34 35 36 34 31 +28 29 26 28 31 31 +74 75 73 75 77 79 81 85 +46 47 44 47 48 54 +4 6 8 8 11 12 15 18 +80 81 81 82 79 +51 52 54 56 56 59 59 +49 51 51 53 56 60 +47 50 53 55 55 62 +6 8 12 15 17 19 21 +86 89 90 92 96 98 99 96 +77 78 80 83 87 87 +55 58 60 63 66 70 71 75 +55 57 61 64 69 +83 84 85 92 93 95 +77 78 83 84 83 +26 29 34 37 37 +20 21 23 26 27 33 35 39 +28 29 30 35 36 37 39 45 +62 61 64 67 68 70 +20 18 21 23 26 28 31 29 +72 70 73 76 79 80 80 +48 46 49 52 53 55 56 60 +9 6 7 8 9 10 13 19 +69 68 65 66 69 72 75 +40 38 39 40 39 40 38 +50 48 49 48 48 +81 79 80 79 83 +15 14 13 16 18 23 +10 9 12 14 14 16 18 20 +96 95 98 98 99 96 +79 77 79 79 79 +61 59 61 62 63 63 66 70 +17 16 17 18 19 19 21 28 +22 21 25 27 28 +35 33 34 38 41 39 +62 61 64 65 69 69 +46 44 47 51 53 55 59 +46 44 46 49 50 51 55 62 +41 39 46 48 50 +39 38 45 46 45 +78 75 82 85 85 +22 21 23 26 28 34 38 +6 5 12 13 15 18 24 +58 58 59 62 65 +21 21 23 24 26 29 32 31 +96 96 98 99 99 +84 84 85 87 91 +68 68 71 74 81 +6 6 7 10 11 10 11 14 +31 31 33 36 38 36 34 +54 54 55 57 59 61 60 60 +31 31 33 35 34 37 41 +25 25 27 24 25 30 +82 82 85 85 86 88 90 +39 39 41 43 43 46 45 +39 39 42 43 46 46 46 +88 88 91 91 95 +81 81 83 85 85 86 87 93 +36 36 40 41 43 44 46 +2 2 5 9 8 +8 8 11 12 16 18 18 +79 79 81 85 89 +47 47 50 54 61 +77 77 79 81 88 89 +60 60 63 66 68 74 75 74 +76 76 83 85 87 87 +34 34 41 43 47 +65 65 68 71 76 81 +3 7 8 11 12 14 17 +53 57 59 60 61 60 +28 32 33 34 36 37 37 +45 49 51 53 54 57 61 +55 59 61 63 68 +43 47 50 51 50 53 55 57 +1 5 7 10 13 12 11 +43 47 48 51 48 51 51 +80 84 82 83 85 89 +38 42 44 45 46 44 49 +41 45 47 48 50 53 53 56 +2 6 6 8 11 12 14 12 +10 14 17 20 20 21 24 24 +12 16 18 21 23 23 26 30 +30 34 37 39 42 44 44 49 +53 57 59 62 64 68 70 +68 72 76 77 75 +9 13 16 20 22 22 +78 82 83 87 89 91 92 96 +12 16 17 19 23 25 28 35 +76 80 86 89 90 93 +86 90 91 92 98 99 98 +61 65 68 71 76 76 +24 28 30 36 40 +31 35 37 40 41 46 49 56 +43 50 51 52 55 58 60 +43 48 51 54 56 59 58 +55 62 65 68 70 71 74 74 +10 16 19 20 21 23 25 29 +80 87 89 92 97 +91 96 94 97 99 +82 87 88 85 87 86 +16 23 20 21 24 24 +20 25 22 25 28 32 +27 34 37 36 37 38 45 +80 85 88 91 93 96 96 99 +47 52 54 54 57 60 58 +62 68 70 71 73 73 73 +21 28 29 29 31 34 35 39 +40 45 46 46 47 52 +61 68 70 74 77 79 80 81 +76 81 84 85 87 88 92 91 +79 85 86 90 90 +57 62 65 69 73 +11 18 21 25 28 29 31 37 +74 79 86 87 89 90 91 93 +5 12 14 19 21 23 24 22 +36 43 45 47 48 53 53 +27 34 39 40 44 +64 69 75 78 81 82 88 +55 54 52 51 52 +73 70 68 67 67 +83 82 81 80 79 76 73 69 +24 23 22 19 18 16 14 8 +99 97 95 96 95 92 +23 20 21 20 19 17 14 15 +25 23 24 23 21 18 18 +53 51 49 47 48 46 42 +87 84 82 85 80 +95 93 91 88 88 86 83 +90 87 85 84 83 83 85 +69 66 63 63 61 60 60 +13 11 11 10 6 +59 57 57 56 51 +43 40 37 35 33 29 26 25 +14 13 9 8 6 5 8 +77 74 72 70 66 64 64 +46 44 41 37 33 +59 58 54 51 46 +55 52 45 43 42 41 40 +39 36 35 34 33 28 29 +47 45 40 39 39 +47 45 43 37 35 33 32 28 +96 94 92 87 84 81 79 72 +43 46 45 44 42 40 37 +79 82 80 77 74 73 71 74 +42 44 43 41 40 37 37 +57 58 57 56 53 52 48 +78 79 78 75 74 71 66 +31 32 31 34 31 +25 28 27 29 30 +37 38 37 35 36 34 34 +68 71 70 73 71 67 +20 22 25 22 21 14 +98 99 98 95 95 94 +84 86 83 82 82 80 77 80 +57 59 57 57 56 55 55 +24 27 25 25 22 19 16 12 +53 54 51 48 48 45 38 +28 29 27 26 22 19 +42 44 43 39 36 38 +88 91 90 89 86 82 82 +91 94 92 88 86 82 +27 29 27 23 20 18 11 +16 17 16 10 9 +69 70 67 60 58 57 56 58 +28 31 30 27 26 19 18 18 +58 61 58 57 50 47 43 +69 72 71 66 64 63 61 55 +49 49 47 45 43 +38 38 35 32 29 32 +62 62 59 58 57 56 53 53 +79 79 78 77 73 +28 28 27 25 24 22 16 +49 49 51 50 47 46 +37 37 36 34 31 33 36 +36 36 37 35 35 +50 50 47 45 46 43 42 38 +39 39 38 36 39 34 +28 28 28 27 24 22 21 19 +21 21 19 17 15 15 13 14 +30 30 30 28 25 23 20 20 +79 79 79 78 75 73 70 66 +47 47 47 46 40 +72 72 70 66 64 62 +49 49 45 44 45 +82 82 80 76 74 72 72 +26 26 22 20 16 +71 71 67 64 63 60 54 +95 95 93 87 86 +15 15 14 13 12 6 8 +69 69 66 64 58 58 +36 36 34 33 26 23 22 18 +22 22 17 15 10 +33 29 27 26 25 22 +25 21 18 15 14 17 +71 67 64 61 61 +71 67 65 62 59 58 54 +89 85 82 79 77 74 72 67 +52 48 47 50 47 46 44 42 +55 51 49 46 49 46 48 +8 4 2 5 5 +86 82 84 83 79 +38 34 32 31 28 29 24 +49 45 42 40 40 38 35 32 +24 20 17 15 15 12 15 +72 68 65 65 65 +67 63 61 58 56 53 53 49 +45 41 40 38 36 36 29 +44 40 37 33 30 28 +24 20 17 13 11 8 10 +60 56 54 50 49 48 48 +30 26 25 21 17 +26 22 20 17 13 12 5 +32 28 26 20 17 +43 39 38 33 30 28 26 29 +94 90 85 82 82 +81 77 71 68 66 62 +99 95 94 89 88 81 +21 16 15 14 13 12 +83 76 75 74 73 70 69 71 +73 68 66 65 63 62 59 59 +44 37 35 32 28 +91 86 83 82 81 79 78 72 +96 90 92 89 86 +33 27 25 28 25 23 24 +32 27 24 22 20 23 20 20 +64 57 60 57 53 +43 36 33 30 28 31 26 +10 5 5 3 2 +65 60 58 58 55 58 +69 63 63 61 61 +70 65 62 61 61 57 +56 51 50 48 45 45 42 36 +75 70 66 65 62 +17 11 7 5 6 +36 29 25 22 20 19 18 18 +26 20 18 14 13 9 +43 38 35 34 32 30 26 19 +66 60 54 52 49 +54 47 41 38 37 35 36 +40 33 26 25 25 +31 26 24 22 19 13 12 8 +80 73 71 68 62 57 +11 8 9 16 17 19 22 22 +25 25 27 26 25 24 22 20 +71 75 78 82 85 88 91 +24 26 29 33 34 37 40 42 +39 45 45 46 47 49 51 +42 42 44 45 48 52 +92 95 92 92 92 +53 56 55 53 53 50 46 +79 75 72 71 70 67 67 +26 26 23 19 18 14 +86 85 88 91 92 95 96 98 +35 35 38 37 38 +12 12 13 11 6 +27 23 26 24 23 23 +35 39 42 43 46 49 52 54 +30 24 24 21 18 15 14 14 +61 55 52 50 48 46 43 46 +9 7 9 10 8 +67 68 66 59 55 +52 56 59 60 63 64 68 65 +11 14 16 19 22 29 30 35 +52 58 59 65 66 +40 45 48 53 55 59 +47 47 50 52 56 58 62 +37 41 41 44 47 50 +22 19 16 15 18 +21 21 23 27 30 +68 72 73 74 76 77 80 84 +61 66 67 71 72 75 73 +60 63 62 55 54 +46 50 53 55 55 59 +60 58 59 58 55 51 +72 68 61 58 56 55 58 +25 24 27 28 30 34 38 +14 17 18 20 22 25 23 23 +47 40 37 35 34 +57 58 59 65 67 66 +74 69 62 61 60 57 58 +4 10 14 16 17 20 +13 18 19 20 19 22 29 +54 54 51 50 45 +72 69 71 73 70 74 +84 79 77 80 79 74 +25 25 25 24 22 +86 86 85 85 82 80 77 79 +68 65 67 72 73 74 +29 29 27 27 24 21 21 +59 61 63 62 65 69 +45 42 41 38 36 32 31 +45 38 39 37 33 +79 76 76 73 72 +31 32 31 27 21 +9 9 8 9 10 12 14 17 +47 51 54 57 57 +26 25 26 29 30 37 +91 90 88 85 81 78 74 +53 56 52 50 50 +51 47 46 43 42 39 33 +84 77 76 72 69 63 +41 40 39 41 39 38 37 37 +74 78 76 79 79 +64 64 59 57 56 56 +69 72 69 70 72 75 82 +27 32 35 36 34 +31 26 25 21 20 19 15 +67 67 70 76 79 84 +33 35 36 37 39 41 42 39 +35 32 32 29 29 +57 54 52 49 47 46 46 47 +1 5 8 10 12 13 10 13 +37 38 42 45 46 49 55 +86 91 92 94 94 92 +88 86 83 80 78 77 73 +3 5 6 10 10 +24 24 27 30 30 34 +17 15 13 16 18 15 +57 54 52 52 51 50 46 +46 43 45 46 49 51 51 52 +70 68 65 63 58 +49 55 59 60 60 +53 46 45 45 42 41 40 35 +47 51 52 58 65 +27 29 26 23 25 +23 19 16 10 8 5 1 +98 91 91 89 92 +59 59 58 55 54 53 51 +56 63 60 62 64 67 69 +3 9 9 11 14 14 +86 83 84 82 80 74 +74 77 80 80 83 85 88 88 +24 20 20 17 10 +56 62 64 65 66 69 73 +1 5 7 9 15 12 +60 63 67 70 69 +63 66 69 70 76 79 82 +38 38 36 34 32 30 31 +44 47 46 45 44 44 41 40 +66 66 67 64 71 +1 7 8 9 11 14 +13 16 15 14 12 11 11 +75 72 66 65 64 64 +56 59 56 59 57 56 52 +27 20 17 16 10 6 +19 23 27 30 30 +95 98 97 93 90 +33 37 37 40 42 40 +36 42 44 42 43 46 50 +94 88 82 79 78 71 +17 13 11 9 5 4 4 +88 88 89 91 92 95 95 92 +97 93 90 88 85 88 86 83 +15 12 12 14 17 24 +7 10 9 8 11 8 2 +59 55 54 51 47 +60 57 59 57 58 +74 79 82 85 89 94 +24 19 15 12 10 7 +12 7 5 2 2 +38 36 33 34 37 38 38 +36 32 32 31 27 +15 20 21 28 31 37 +79 79 80 82 80 +95 91 90 89 86 83 80 81 +89 86 86 87 89 93 +3 6 4 6 3 4 +65 61 59 56 55 53 52 51 +27 26 28 31 38 39 45 +81 84 87 91 95 +71 71 68 66 65 62 59 59 +28 28 27 25 25 19 +90 94 96 97 94 +63 63 67 68 69 66 +68 68 66 65 60 59 58 51 +92 92 86 85 82 80 76 +26 27 24 25 26 25 +73 78 84 86 88 91 91 +42 44 43 40 42 40 40 +73 80 82 85 85 +44 44 46 53 56 +29 25 22 20 16 15 18 +33 30 35 38 39 42 44 48 +87 87 85 80 79 78 +37 44 45 43 42 +87 87 89 91 95 97 97 +82 82 83 83 84 86 88 88 +90 90 88 90 92 95 97 97 +82 85 88 87 84 83 82 81 +70 70 73 75 77 83 +57 55 54 56 57 59 +26 19 16 11 9 +64 65 63 61 57 54 57 +81 85 86 87 92 93 95 +10 14 18 21 22 25 32 +70 66 63 61 58 52 49 46 +35 30 27 25 22 25 23 +71 77 77 79 81 82 83 90 +17 16 17 18 17 19 21 28 +31 30 23 21 24 +47 47 50 51 54 56 59 59 +74 74 71 73 70 67 64 60 +6 11 15 17 18 22 +59 55 55 53 51 51 +51 45 42 39 42 41 41 +22 29 32 30 32 32 +58 56 57 61 62 63 66 68 +16 16 12 9 7 6 8 +61 57 53 52 50 44 +60 58 55 58 55 +45 45 50 52 54 57 60 64 +31 28 29 31 35 37 40 40 +86 86 89 91 94 +32 25 23 16 13 13 +83 82 81 78 75 72 69 69 +52 56 59 61 62 63 61 66 +56 50 49 46 40 +15 18 18 17 20 +18 15 11 8 6 8 +72 72 71 67 62 +85 87 85 79 81 +36 39 37 35 33 31 31 24 +41 40 37 33 30 29 22 +63 67 67 69 71 72 79 +41 39 41 45 44 +20 23 25 26 28 29 32 36 +45 49 52 49 51 52 54 58 +48 46 40 37 30 +52 54 54 57 63 +8 11 14 17 19 18 19 +99 99 92 90 93 +14 12 13 14 20 21 24 22 +56 60 61 62 63 65 70 +38 34 36 33 31 30 28 24 +35 33 32 30 28 26 19 15 +66 68 65 62 55 48 +15 9 11 10 7 5 7 +82 82 85 92 95 97 97 +80 80 81 80 82 83 84 88 +40 36 38 35 33 28 +97 95 92 90 87 85 84 +76 77 80 83 84 87 88 90 +81 80 78 77 75 74 +94 93 91 89 88 86 +85 82 79 76 74 73 72 71 +73 71 69 66 64 63 +17 18 21 24 26 29 30 +72 73 76 79 82 84 +16 14 11 10 9 8 6 +25 27 30 33 35 +30 31 34 37 39 +82 84 87 90 93 95 +21 19 16 14 13 11 9 +43 46 49 50 52 55 57 +70 69 67 66 65 63 61 60 +29 26 23 22 20 17 14 +74 73 71 68 66 65 64 +85 83 80 79 77 76 73 71 +10 11 14 16 17 18 20 +47 44 42 39 38 35 32 30 +67 68 70 71 74 76 77 79 +35 37 40 43 45 46 48 51 +66 64 61 58 55 53 52 49 +76 79 80 81 82 83 86 +56 54 51 49 47 +67 64 63 60 58 57 54 52 +10 12 14 16 18 21 24 +79 82 83 84 86 87 89 90 +79 76 75 74 73 70 67 +48 51 52 53 54 57 +42 41 38 35 34 32 29 28 +2 5 6 8 10 11 14 15 +77 75 73 72 69 67 +81 84 87 90 92 93 94 +29 32 35 36 39 42 43 44 +25 24 23 20 19 17 16 +64 67 69 70 73 74 +17 19 20 21 22 24 25 +42 43 44 45 48 50 52 54 +45 42 41 38 37 +80 78 75 72 69 66 63 62 +8 9 11 14 15 18 20 22 +52 51 50 47 44 +23 20 19 18 16 15 14 +18 21 24 25 26 +86 88 89 91 93 94 95 97 +5 6 9 11 14 17 18 +74 73 72 71 70 68 +70 73 75 77 80 +56 59 60 61 62 64 67 +21 24 26 29 32 34 35 37 +31 34 36 37 38 +18 15 13 10 8 7 4 +36 39 42 44 45 47 +71 74 76 77 78 79 82 +31 34 36 38 39 42 +20 22 23 24 26 28 29 +72 71 70 67 64 62 61 58 +71 74 75 76 77 78 80 82 +49 50 53 56 57 58 61 +15 14 13 10 7 6 3 +28 26 24 21 19 16 14 +50 47 46 45 43 +37 36 35 32 30 +71 69 66 63 62 61 60 +62 64 66 68 69 72 74 76 +40 41 42 45 48 50 +20 17 16 15 12 11 10 +9 10 13 15 17 20 23 24 +38 39 42 43 44 45 +18 19 20 23 24 27 28 29 +5 8 9 12 14 16 17 +58 55 54 53 51 49 +15 18 21 23 25 +20 19 18 16 15 13 +69 67 66 63 60 58 57 +64 61 60 57 54 52 50 49 +20 22 25 26 27 28 +42 45 48 50 52 55 57 +18 17 15 13 12 10 +22 19 16 15 14 11 9 +67 64 61 58 55 53 51 +50 52 53 56 59 62 65 68 +52 55 57 58 60 62 +40 38 37 35 32 31 30 +69 68 66 65 63 61 58 +49 48 45 42 40 37 34 +37 36 34 31 28 +52 53 56 59 60 +39 41 42 43 45 48 51 52 +15 16 19 22 23 +84 86 89 91 92 95 97 99 +83 86 88 90 92 95 +63 64 67 68 71 +90 87 85 83 82 79 +56 58 60 62 63 64 66 69 +14 12 10 9 6 +43 42 41 40 37 +18 16 15 14 11 +57 58 59 61 64 66 +60 59 56 55 52 49 48 +19 21 22 23 26 29 +49 47 46 43 40 +84 85 87 89 91 94 96 +61 60 58 56 53 50 47 44 +66 67 70 73 75 78 80 81 +27 25 22 19 18 15 13 10 +44 47 48 49 52 53 54 56 +17 14 11 9 6 4 +94 91 88 86 85 +58 57 55 52 51 +90 89 87 85 84 81 80 78 +35 37 38 41 44 45 +38 39 40 41 43 +89 90 92 93 94 97 98 +62 59 58 55 54 52 51 49 +9 12 14 16 17 19 22 24 +94 92 89 86 85 84 81 78 +28 30 31 34 35 36 38 41 +59 61 64 65 66 69 70 72 +77 76 75 72 71 70 68 65 +55 54 52 49 48 47 44 +96 94 93 92 89 +40 41 42 45 46 48 50 53 +52 53 54 56 58 60 62 +98 97 94 92 89 88 87 86 +68 69 72 75 77 80 +49 48 47 44 41 39 36 +57 56 53 51 50 48 47 +11 14 15 17 20 23 26 28 +21 19 18 16 14 +49 51 54 57 60 63 66 69 +50 47 46 44 42 41 39 +45 42 41 39 36 33 32 30 +47 48 49 52 53 55 56 +79 80 82 83 85 86 87 90 +31 28 27 26 23 +3 6 7 10 13 +84 85 88 91 94 95 96 +59 57 55 52 50 49 +55 52 49 48 45 44 +13 14 16 18 19 20 +70 71 74 77 78 80 83 +36 38 39 42 45 46 49 50 +95 93 90 87 86 85 83 +14 17 20 22 25 +20 18 16 15 14 13 12 9 +32 34 35 36 39 40 41 +31 34 36 37 39 40 43 +73 72 70 67 64 +47 48 50 53 54 +91 88 85 84 83 81 79 77 +49 46 44 41 39 37 36 +20 19 18 17 16 15 12 +86 88 89 92 93 96 +78 80 81 84 87 88 90 91 +22 20 19 18 16 13 +2 3 6 7 10 11 +41 38 37 34 33 30 28 +28 27 24 23 21 20 17 14 +74 77 80 81 82 84 +69 67 65 64 63 62 +81 79 78 76 73 72 +54 53 52 50 47 +17 16 15 13 11 +57 59 60 62 64 +23 25 27 30 32 34 +29 26 25 24 23 +30 28 26 25 22 19 18 +70 67 64 61 58 57 +62 64 65 68 71 +83 86 89 92 93 94 96 99 +47 45 44 43 40 37 35 34 +47 48 49 52 55 57 59 60 +3 4 7 10 13 15 18 +64 66 68 69 70 73 +18 21 24 25 27 29 +73 70 68 65 62 59 58 56 +68 65 62 60 59 57 54 52 +11 8 6 3 2 +28 29 31 32 34 35 36 +37 38 41 44 46 48 49 +60 61 64 67 70 73 75 76 +22 23 25 28 29 +84 87 90 92 95 96 99 +31 33 34 35 37 40 41 42 +70 68 67 65 63 +82 84 87 88 90 92 94 95 +86 88 89 92 94 +72 69 68 67 65 64 63 +79 82 85 86 87 90 +29 30 32 33 36 37 39 +36 38 39 42 43 45 47 50 +70 67 66 63 62 60 58 55 +25 26 27 28 31 34 +82 80 77 75 74 73 72 70 +3 6 8 11 12 15 +29 30 33 35 38 41 42 43 +44 45 48 49 52 55 57 +47 49 51 53 56 58 +60 59 57 55 52 +22 25 28 29 31 33 +22 21 19 16 14 13 +19 21 24 26 29 32 34 37 +49 46 43 42 40 37 34 +40 37 35 33 31 29 27 25 +84 82 80 77 74 71 70 +75 73 70 67 64 61 59 +55 52 51 49 48 +71 74 76 77 79 81 +57 59 61 63 64 67 70 +55 54 53 52 50 49 46 45 +44 47 49 51 52 53 55 57 +84 87 88 91 94 +79 77 76 73 70 67 65 64 +48 47 44 42 39 38 36 35 +38 36 35 34 32 29 27 26 +58 61 64 67 70 +83 85 87 89 90 91 93 +70 69 68 66 64 62 60 58 +25 22 20 17 16 +59 62 64 67 70 73 74 +56 55 54 51 50 +36 37 38 41 43 44 47 +48 46 45 42 41 40 37 +41 40 39 37 35 33 31 29 +52 49 46 44 43 42 +72 73 75 76 78 79 81 84 +75 77 80 81 84 87 88 90 +28 29 31 32 34 37 +20 22 24 27 28 31 33 34 +39 37 34 31 29 26 23 20 +15 16 18 19 21 24 +36 38 40 41 44 47 48 49 +10 12 14 17 18 19 22 +27 24 23 22 19 +90 87 86 85 82 79 76 +34 35 36 37 40 42 45 +66 64 62 59 56 55 54 +60 62 64 65 66 67 70 +37 38 40 41 42 43 +79 78 77 74 73 70 68 65 +22 21 19 18 15 +95 94 93 92 89 88 +75 72 69 66 65 +25 22 19 16 14 13 12 9 +30 31 32 33 35 +5 6 7 9 10 13 14 17 +82 83 85 87 89 92 93 94 +54 52 51 48 46 45 +35 32 29 28 27 25 23 20 +51 49 46 43 42 40 +39 38 35 32 30 27 +48 45 42 40 38 37 35 +59 58 56 53 51 48 45 +76 75 73 70 68 66 63 +68 71 74 77 80 81 82 +28 29 31 34 35 +88 90 91 92 94 95 98 99 +69 68 65 64 62 +88 86 83 81 80 +85 88 89 92 93 94 96 +38 36 34 33 30 27 26 25 +69 70 71 73 74 77 +22 24 27 29 32 33 35 +80 81 83 85 87 89 91 92 +47 49 51 53 54 56 58 +45 44 41 38 36 33 30 +16 18 19 21 24 25 26 29 +69 70 73 76 77 80 82 +86 85 83 82 80 77 +7 8 10 11 12 13 +68 65 62 60 57 +20 17 16 14 13 12 +90 87 86 85 83 82 80 79 +20 18 16 14 13 10 +36 38 41 44 47 48 +64 66 69 70 72 +94 91 88 85 83 80 +25 26 29 32 33 36 +26 24 21 18 17 +63 60 59 56 54 +40 39 38 35 32 30 +60 63 65 67 69 71 72 +16 15 12 10 9 +49 51 54 57 58 59 62 +48 49 52 54 55 58 61 +36 35 32 31 29 +73 70 69 66 63 61 59 +16 18 19 22 25 +32 30 28 26 25 22 20 +39 42 45 48 51 54 +70 72 73 74 76 79 80 81 +37 34 31 30 29 +15 16 17 19 21 24 +31 30 28 25 23 20 18 17 +81 82 83 86 89 91 92 94 +78 76 74 72 71 +24 25 28 30 31 32 +80 79 76 75 73 72 71 +71 72 74 76 78 81 84 86 +8 11 14 15 18 +46 43 42 41 38 35 34 +20 18 17 15 14 +84 82 80 79 77 76 +43 44 47 48 50 \ No newline at end of file diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..ceba3fe --- /dev/null +++ b/main.ts @@ -0,0 +1,21 @@ +import type { Solvable } from "./solvable.ts"; + +const solutionFiles = Deno.readDirSync('./solutions'); + +const solvables: Solvable[] = []; + +// need to wrap this stuff in a function to not trip the top level await +(async () => { + // cool dynamic module loading + for (const solution of solutionFiles){ + await import('./solutions/' + solution.name) + } + + if (import.meta.main) { + // only solve the latest day + solvables.toReversed()[0].part1().part2() + } +})() + + +export { solvables } \ No newline at end of file diff --git a/solutions/01.ts b/solutions/01.ts new file mode 100644 index 0000000..9fd198d --- /dev/null +++ b/solutions/01.ts @@ -0,0 +1,40 @@ +import { solvables } from "../main.ts"; + +import type { Solvable } from "../solvable.ts"; +import { readInput } from "../utils.ts"; + +class DayOne implements Solvable { + input = readInput('01') + + public part1(): DayOne { + const vals = this.input.trim().split("\n").map(line => line.split(' ')) + const left = vals.map(line => Number.parseInt(line[0])).sort() + const right = vals.map(line => Number.parseInt(line[1])).sort() + + const diff: number[] = [] + left.forEach((left, idx) => { + diff.push(Math.abs(left - right[idx])) + }) + + const result = diff.reduce((prev, curr) => prev + curr) + console.log(result) + return this + } + + public part2(): DayOne { + const vals = this.input.trim().split("\n").map(line => line.split(' ')) + const left = vals.map(line => Number.parseInt(line[0])).sort() + const right = vals.map(line => Number.parseInt(line[1])).sort() + + const countedOccurences: Map = new Map() + left.forEach(left_val => countedOccurences.set(left_val, right.filter(right_val => left_val === right_val).length)) + const result = countedOccurences + .entries() + .map(([left_val, occurences]) => left_val * occurences) + .reduce((prev, curr) => prev + curr) + console.log(result) + return this + } +} + +solvables.push(new DayOne()) \ No newline at end of file diff --git a/solutions/02.ts b/solutions/02.ts new file mode 100644 index 0000000..49672b6 --- /dev/null +++ b/solutions/02.ts @@ -0,0 +1,18 @@ +import { solvables } from "../main.ts"; + +import type { Solvable } from "../solvable.ts"; +import { readInput } from "../utils.ts"; + +class DayTwo implements Solvable { + input = readInput('02') + + public part1(): DayTwo { + console.log("test") + return this + } + public part2(): DayTwo { + return this + } +} + +solvables.push(new DayTwo()) \ No newline at end of file diff --git a/solvable.ts b/solvable.ts new file mode 100644 index 0000000..88cd5cb --- /dev/null +++ b/solvable.ts @@ -0,0 +1,6 @@ +interface Solvable { + part1(): Solvable; + part2(): Solvable; +} + +export type { Solvable } \ No newline at end of file diff --git a/utils.ts b/utils.ts new file mode 100644 index 0000000..137315f --- /dev/null +++ b/utils.ts @@ -0,0 +1,5 @@ +function readInput(day: string): string { + return Deno.readTextFileSync('./inputs/' + day + '.txt') +} + +export { readInput };