diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-05-20 09:27:09 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-05-20 09:27:09 +0800 |
commit | 63fb1f2d4cbaffaf47acb762418d67329b83eb33 (patch) | |
tree | c0761e62e38f8ee144f2b628f3814d3dd23defe3 | |
parent | fb70adadde012ecb15424c6a61892cd8344311d3 (diff) | |
download | advent-of-code-63fb1f2d4cbaffaf47acb762418d67329b83eb33.tar.gz advent-of-code-63fb1f2d4cbaffaf47acb762418d67329b83eb33.zip |
day9 inputs
-rw-r--r-- | src/2016/day9/README.md | 17 | ||||
-rw-r--r-- | src/2016/day9/input | 1 | ||||
-rw-r--r-- | src/2017/day9/README.md | 42 | ||||
-rw-r--r-- | src/2017/day9/input | 1 | ||||
-rw-r--r-- | src/2018/day9/README.md | 50 | ||||
-rw-r--r-- | src/2018/day9/input | 1 | ||||
-rw-r--r-- | src/2019/day9/README.md | 35 | ||||
-rw-r--r-- | src/2019/day9/input | 1 | ||||
-rw-r--r-- | src/2020/day9/README.md | 46 | ||||
-rw-r--r-- | src/2020/day9/input | 1000 | ||||
-rw-r--r-- | src/2021/day9/README.md | 22 | ||||
-rw-r--r-- | src/2021/day9/input | 100 |
12 files changed, 1316 insertions, 0 deletions
diff --git a/src/2016/day9/README.md b/src/2016/day9/README.md index e69de29..9d5ed19 100644 --- a/src/2016/day9/README.md +++ b/src/2016/day9/README.md @@ -0,0 +1,17 @@ +--- Day 9: Explosives in Cyberspace --- +Wandering around a secure area, you come across a datalink port to a new part of the network. After briefly scanning it for interesting files, you find one file in particular that catches your attention. It's compressed with an experimental format, but fortunately, the documentation for the format is nearby. + +The format compresses a sequence of characters. Whitespace is ignored. To indicate that some sequence should be repeated, a marker is added to the file, like (10x2). To decompress this marker, take the subsequent 10 characters and repeat them 2 times. Then, continue reading the file after the repeated data. The marker itself is not included in the decompressed output. + +If parentheses or other characters appear within the data referenced by a marker, that's okay - treat it like normal data, not a marker, and then resume looking for markers after the decompressed section. + +For example: + +ADVENT contains no markers and decompresses to itself with no changes, resulting in a decompressed length of 6. +A(1x5)BC repeats only the B a total of 5 times, becoming ABBBBBC for a decompressed length of 7. +(3x3)XYZ becomes XYZXYZXYZ for a decompressed length of 9. +A(2x2)BCD(2x2)EFG doubles the BC and EF, becoming ABCBCDEFEFG for a decompressed length of 11. +(6x1)(1x3)A simply becomes (1x3)A - the (1x3) looks like a marker, but because it's within a data section of another marker, it is not treated any differently from the A that comes after it. It has a decompressed length of 6. +X(8x2)(3x3)ABCY becomes X(3x3)ABC(3x3)ABCY (for a decompressed length of 18), because the decompressed data from the (8x2) marker (the (3x3)ABC) is skipped and not processed further. +What is the decompressed length of the file (your puzzle input)? Don't count whitespace. + diff --git a/src/2016/day9/input b/src/2016/day9/input index e69de29..e90f6fb 100644 --- a/src/2016/day9/input +++ b/src/2016/day9/input @@ -0,0 +1 @@ +(190x9)(44x13)ZAVXETEBULPKEEYPUUMBWUPDHPXFDPIEWHXPNVMSKMMN(55x14)(6x12)VZQPAA(18x4)ITWIARZWEBBNFBLOGV(13x7)QYTKGAIZHUZAX(4x10)ITDZ(61x3)(1x7)Y(6x2)ZPMQZV(8x15)OIHTQPNI(23x12)CAXCRVLMLAKHPBUUODXQQNT(3x9)WJP(5x12)PJAMH(43x13)(30x13)RWAWRZCDEMSPYFDZVVUKZUWSEVFJWH(1x9)N(17x13)(11x4)YHEKAEQQQFW(3x13)SQF(195x4)(56x5)(4x8)PBWL(6x8)HWRMIA(2x5)QQ(8x9)JOISJLQL(10x3)JBKQBBPQGK(125x11)(24x13)ELKCLOFLJRFIJCIIRMCOZEPC(7x6)LWRTOXG(14x3)WPNDOOJCSZHKJA(23x10)VUBKGHFYHCEKZMNKIDYWIDY(25x15)FOFQQVCWHFRSRVRSYMYRCZRIF(141x14)(45x2)(12x1)UWTFPNJDKWSG(10x11)DHIUEFRJAQ(4x10)WSOX(53x15)(15x3)UHDWGLSDIHUYSMD(6x10)GALIPI(13x13)UBIUGFWYWMHCR(24x1)(18x3)SAGTVYELUTWSXQVWNI(10x7)GENZOXBYOG(4x2)RMGS(4177x12)(1752x3)(1513x4)(297x4)(10x5)(4x15)PBBT(160x14)(11x6)JCKLDJGYMGO(60x1)(5x4)SOMMG(5x1)MJENB(3x11)IIR(24x12)FQAMKJSXTZCAVAEDEQFQMWIR(70x12)(25x2)FWNHIGOHOUYCQSCUKSSCZXRJI(2x11)XF(17x3)VGTLRDJNDBERXWRAY(3x8)AJT(94x8)(68x10)(21x14)DUGIEEMZURLSHXEPSDMDH(5x11)LISKT(13x14)UMVAIVVRDTOSG(4x9)PGOV(13x4)(8x9)KWQGNJIV(8x2)RLEKKJWG(383x11)(75x1)(21x3)SBABSNIPBMLCXQECMVDGB(42x2)(11x2)ESWFOYEVFIJ(2x7)EL(5x13)OCVGF(1x14)J(189x1)(25x2)(8x13)SUFVDTKX(6x1)EOKRWU(28x4)(6x3)SRAGHT(1x15)H(5x8)VNPVG(24x6)(6x4)LOUBGC(8x9)EFISAKFG(9x13)XXKXSZNFD(73x1)(16x12)HOCOHBXNQRXTLLTJ(13x2)LGGHDLJZCIJOG(24x11)PHJDXXBUJTPSKMLGCALDLLGU(2x15)YU(91x11)(3x4)LMM(16x8)DYOHACMPKIHRDUVJ(44x9)(3x2)MDC(5x10)FNPGJ(11x1)OHPDVNRKRSI(2x10)YS(5x13)RURCD(134x15)(121x7)(7x13)XTFRZSM(70x9)(8x15)SNLOWPVP(12x9)MYKDYCTXIAZA(13x9)XMZEHDZTPTAES(13x9)TQLYGXTECVDBG(5x10)EXPSZ(15x7)GVFTLYYYBLGGUJO(1x7)N(14x15)WNZDWNHWJQOQNH(648x6)(83x14)(55x11)(2x13)RP(9x10)MJPOSAGCX(26x7)NXVQZQAQDWHABJFPRVMGSBACWU(14x15)ECVUEOUGLOEJUY(232x13)(30x6)(2x11)NZ(1x13)S(2x8)AR(3x9)DDI(45x3)(4x10)FFJD(7x7)ZRGGRXE(6x10)WJKSTC(5x13)NEQXI(85x9)(4x9)JCLI(14x4)HCVHVWLAFIUSIZ(4x1)BISN(26x2)HRPEKOHFGEJLJDGIWVLQOWJJKU(9x14)YXKJROSLO(17x12)(11x8)HFLFUQNVNMK(23x11)(1x1)N(10x13)TMNKWOOVPB(192x11)(26x1)(4x10)TCAP(3x5)LHN(2x15)DK(36x8)(13x13)UIDKJYPXBFPFO(10x8)BGWMNGEBRF(18x7)SIXYKHPJJONMMHQCRB(5x15)JGIRA(77x3)(5x4)MHAXO(3x8)WSI(15x14)AVHDFYABFZSAOJP(30x15)XNZULOJGEPQDRSHDYHHTBLEMRMPYSB(111x9)(75x13)(10x4)EBCINBYRMS(10x6)XNEZNHZJCE(7x13)HQOEZCA(14x4)OAIKFNURYAWDQK(5x5)VCRLS(22x14)ZROMOTQACGRYTSVCXIEEBP(16x13)(10x5)RKGNREWXGD(200x10)(77x1)(70x15)(25x5)(11x5)OEDHHSUIKNC(3x5)XKD(15x6)EIDHHIZMJRRAGSP(12x9)QNZKKKFEGAMM(110x1)(103x1)(74x12)(32x9)XABWGIVXFJVAMTILWOQXFNMJZSMAVHFY(30x8)TPBSRMCDOQNNAVZQPPZADGDWQAYWCV(16x2)WSDGMBKDJSOACIFW(2x9)XS(2401x11)(808x3)(1x5)F(99x6)(11x15)(5x12)BNHZF(75x9)(68x14)(12x13)UBFYCZHLDIRJ(2x2)EM(18x13)KNOLWZIARZVDYPKPPL(1x11)D(4x10)QFDT(136x10)(47x3)(28x12)(2x10)SO(8x8)TUBVOBJB(1x12)V(7x4)(1x12)R(2x3)TW(47x15)(40x10)(9x3)IPNMPMMCD(1x1)O(3x6)BKR(6x15)DOOFGK(5x15)KNCGF(6x3)(1x3)E(148x4)(9x13)(3x12)UZC(4x12)VKWP(38x8)(12x9)(7x8)IKLDJWW(1x8)I(9x5)FIBXVUYFN(72x13)(32x11)(19x7)SLSTSSNZPVSNIBPYQRS(2x8)UA(6x11)KXTTMX(4x10)MJMA(5x15)EKHFC(391x7)(3x1)DMD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11)ZT(1x5)R(232x7)(25x2)(18x14)QVUIOCQAEZLOTZVXIX(77x7)(22x15)HVHLSATCKEFKLWYRPJXKSI(3x2)PNW(33x12)UTZCGONSVMLAPWTAZILLBRNDOABBZBLRQ(11x6)VCKFJVKSNFC(3x5)COU(86x11)(8x12)YLWMFUKC(16x12)HKQZWQXAQEZELTKJ(6x4)DKEVJB(16x14)WKKMITBLHTJDDIBV(9x11)XPSECVOAO(165x4)(62x1)(11x3)LBEETPNBLEO(5x14)RYYQP(5x5)UHLVY(18x2)OONYEICVPEDLQHIUSJ(36x4)(30x4)KQGSBKSAIDHYDRXEBMNLIHLYXVPEZH(8x13)SYVNWDUT(34x12)XLWWYVKPHEMTJBEQYGKHOQDSHVAGNVMFJK(139x13)(27x7)(1x5)C(4x15)JBBW(5x13)AJJKR(56x11)(18x7)MIPUIIWUHSWCQMEGYN(6x1)MEHVUR(14x11)LOIATKARYOHUJU(37x6)UVKYKHPRZUJFSTUUKFTQIIKKNZOLCQLLBJXVV(5x7)NTEYE(258x7)(33x2)(4x12)EAPG(5x6)SFYVB(8x8)BPGFSFVY(57x7)(1x9)S(44x11)(2x1)RO(1x11)S(24x1)GDRUIEUMOHITSMXDIDGJARJQ(15x6)(9x13)VJZKHBRCR(127x10)(23x12)(1x9)V(3x4)HEI(4x9)OFWY(10x2)BBSZRMWOHR(7x15)(1x15)M(31x5)CKEZCRPSEGEZDYRPWQUKNPMCBTNSPAI(25x5)(1x9)J(12x15)BSSMRDPRNPDY(3785x8)(8x3)GHOEWPFD(1806x14)(124x10)(105x8)(10x9)CDDMAEIXOO(37x3)(10x4)(5x5)VPMMI(3x5)GBP(7x14)VJHBABZ(18x14)XNTKDFTRBCZEACZALZ(14x12)TYBGBOIYRCVRZU(7x2)IORHKKB(590x10)(54x8)(17x6)UTOVYCYKDKKEIUCAI(25x9)(19x6)HIWIXDNGZZJGIACNPPQ(523x7)(41x4)(1x1)I(7x4)(2x6)GU(17x1)DZVZPWJUHXFIHHPFP(196x13)(5x7)OSDSW(15x3)SRTTJWWSYUJGBFF(27x2)(4x13)MSYH(4x1)SXNR(3x2)DPR(70x2)(16x13)QCNXMJXCKTMHZPBM(2x10)FO(25x6)AEVXNJGKTBCPMCUASWXOWHAQS(3x8)GOG(50x2)(14x9)AAGJSTOOBANCTR(14x5)MDCWUWOSELBMGX(4x10)YYLT(10x15)SQZZGFJLDT(133x13)(57x11)(7x11)DDNXMAC(2x12)DV(5x11)UBANO(19x6)NLORMPBFFBOYBQIBZWV(6x8)ASEPWF(21x12)(14x12)FHGWBAXHALMVQI(17x7)(10x13)CCDGPEISBV(2x2)OX(107x3)(7x1)QNMWYFE(18x3)LMFXMYUQKABGXVOUVV(7x9)(2x1)BF(37x15)(12x8)KTBAPXKZLKWT(1x9)W(8x1)GSDNJDSU(9x15)KYVQMDMQW(593x4)(255x7)(146x11)(40x9)(33x12)YLECKKJDQVAMUFFXPWGHUSOECCHZXBLWM(93x10)(3x10)BXC(1x9)U(2x10)BF(18x10)SGORQZUALUTFAVYLPW(39x9)WQGBTEVNTRHTIWQAWVJKIXJVCVMKRGQMPPMIFSF(94x13)(88x1)(5x11)EEUOH(31x13)FSLFXZCUXOXHREPXRPFAWSEABNPADCE(5x7)KEMTG(4x13)GDAZ(13x1)JCRZXVSFBDJZK(4x12)SITF(269x14)(24x3)(7x13)YXQHGKY(5x14)ROOVW(205x14)(10x12)ZZBVWTQWEV(56x11)(1x6)R(10x6)NFOTUTICTJ(8x12)JZWVIHBE(13x13)UBIZNBBEZOIID(28x2)(14x14)HLADLLCONGEPXC(2x2)NH(9x14)(3x15)YCB(69x11)(14x13)QXFXOJBHONIVVJ(5x15)YJMER(6x12)ITSZWH(18x12)IGLEYGQAABOWKMXFGE(20x3)(14x5)(9x7)MSOAXHAID(38x3)IZFZRYYEJVCORBDLTYOHLZHKVDKQVADYQISGTW(469x1)(18x3)TWUUVIXHGSCVVDOFDJ(437x12)(86x8)(40x6)(19x9)OSYGQMGNNLPBKXEPHQG(1x12)M(3x2)PQT(17x15)TQQBGULRUKIXBPYZW(10x7)(5x9)TZMKP(75x3)(68x14)(13x7)QTDRLDGGUIORW(9x10)JTAZPINDH(17x12)KEVECGSLNRMIRBAZO(5x5)DVTUL(199x6)(60x4)(13x11)NWEDTFZTDQWFY(3x3)JBP(4x4)PYBQ(16x11)XZRNQJPUOMZZMYYR(77x2)(2x15)ZK(1x11)V(3x5)BRV(30x13)NLHYJDBXRMCZOQRFXABZUZILEHZMZX(11x9)QONGFLBHCQU(26x3)(5x4)WWVVY(2x15)ZH(3x7)MDR(6x3)PCMRSD(2x1)AA(2x14)PG(44x3)(6x1)CVWMIH(7x13)HSQHXKD(13x14)(7x11)WGEPOEK(1507x5)(39x1)OMGCAFYYXDFVRVNEYPBATJCKBHTRSMGIWTDNIFP(21x9)BDIJRNXYMIRXXILMGIFQK(404x11)(23x15)(9x3)MWBTTYJCT(4x4)UEQO(15x10)GUYNAWLCLNHJPXD(5x5)CECRY(334x14)(67x10)(60x14)(4x13)ZBQU(3x7)SJI(3x14)GKR(2x2)YJ(20x5)DJQTDUIFRGDDOOAMZSFM(99x13)(47x10)(14x2)THIPTHUFVLLGXK(11x15)SQGQIYAKKOC(4x4)TNIC(38x10)(6x6)KCQRSL(3x8)JZT(1x11)B(7x1)XFDBCCU(147x3)(8x13)SWNXWSCS(18x5)VDRJWFBVUTWDFZDCLM(62x3)(19x13)NFZAMEONWPPNGFFODDP(14x13)XTOZXOYZJQBPQC(9x12)AOSMZPGZV(8x13)UZOKBJJQ(21x9)(3x11)PFH(7x4)JDSYTAF(1014x11)(386x14)(119x5)(31x6)ORPIVAGZSMEQRAAOQRSMOAFFWVVFBDT(53x1)(5x8)PRHTO(7x15)HXUNQUA(15x5)AJAJOJCLVYZBICO(4x4)DHZH(3x15)BWJ(9x6)TCXBOMXXL(190x13)(54x15)(3x7)OKI(8x11)TPHKZGWA(6x15)RMAXEB(2x11)QZ(7x7)BXCDHWF(14x11)KYUHEMBXSEADVP(49x4)NLMONTYNOIDPEALJJBKPLWHCKBVVBHHUZNGUSULFWUAEBQQCQ(47x8)(2x11)WJ(8x11)ZYDVAWLX(1x6)W(6x5)CJIWBA(2x15)LS(12x7)PEYJTBKWCUPT(38x2)(31x14)(2x2)CL(17x12)ABAKPQWMMGJTORRBB(4x12)GHGK(496x13)(231x7)(60x2)(11x10)PHJQCJOXFHA(6x7)BKEVJY(25x5)MIZCFGZJRGZDMKHUEGZMACELH(27x12)(3x9)SMI(12x15)CCJWNFNOUQGC(101x8)(27x15)PPDYHKWCWZYEEJJPUFXRRYIASUT(17x10)GGFQFHRYKJMXKBBAR(8x3)FTPTBVXE(23x10)CLAVUXEHWTEYZQNRYOGIQME(16x15)(10x8)LAZDAYDVLM(193x3)(9x15)OHPJACNZL(40x14)(1x9)O(17x7)UOFNZKLKAAMBPOHNS(6x6)SZIJWV(54x5)(2x7)FV(7x9)GEWYULA(1x13)U(22x2)ZVSVOAJXMDEMUPOQLTINZF(24x15)TWQIDBTWEPQBMHYKPLYZSVZI(33x15)(20x1)LZUNQTUVMDOOXEDUZFAR(1x13)K(52x3)(46x9)(7x8)WQWZCBB(27x14)HAZIUDWNIFUKQCAWYFJIGEWSLJO(85x12)(55x7)(48x14)(3x4)TBU(22x6)YFSPWGIYYVLXKMNBKZRFMH(7x1)LGZSHDG(2x10)HY(10x2)SLXHMEWSGF(9x8)(4x2)RWUE(434x11)(426x14)(52x8)(21x14)BCBITAXHZMXHHYRZDNOJA(18x1)FKEHYEEXRRMXDUPPLZ(361x9)(127x14)(29x4)(1x11)G(3x5)TXQ(9x2)KKWGNXDII(11x11)RVLXVHDTCUP(68x9)(11x8)YQKPSJFRDFP(16x10)UUEHIVBUTUFRUVDE(2x14)RX(14x8)GVHHPSBTEJUNKN(219x7)(105x11)(21x10)EFKAZUOPPUTTNFYUNJSZO(71x8)HDPQUFFZUXYPEKOWXNNZVQJFIZEYEODJSNYUOAZOIRQETXCRZBGJWWMMPPIIHJEGFYREGNR(38x11)NKGEVBBLDDLGOYUHLBWXSEAQHFNGABJENZQMVU(3x14)TTC(34x1)(6x10)NXQLWI(15x10)EQVLORVBUBZDUMB(7x8)(2x7)VA(5917x1)(2328x4)(814x14)(37x14)(1x10)J(24x6)(17x10)TRMNJJCWQUYENUBXU(445x15)(177x1)(37x14)PUCBAZGPSDOVSUSSZSCCWDCWYILTSEMJVIVZX(17x7)IMEOLAHQLTARXBTDR(65x8)(2x5)YN(14x12)QXEQUHYTHIHLPM(5x5)MTCMS(9x6)FGQLYLJNL(8x8)KHHJLUDZ(32x10)FXSLPGRBINYRWGIWKRRYSEWARGDQDPSW(10x10)WLADYFJIUQ(2x4)XX(209x8)(94x11)(36x15)UKGUJGLESXQIOASTZHMRHEWIEMXOYYIJUKAG(6x6)NCIDZV(7x10)JHACUVQ(21x1)KAGYAGPGGDOGOBXMSNJEQ(91x2)(30x15)UUMCWGDYGHNOBMJTPPZVSZEHNKZCAA(27x9)VXBDEFDWMTIRGHCQSYDYWCSBJPY(8x7)GKMVKFZJ(2x15)NS(5x14)BPRCM(15x3)OPXQHISSCCOQIEA(287x9)(280x8)(21x3)PKYXLJXGOKXSXBZTGDEGK(59x1)(12x13)VGTKVMCQIXTS(2x11)BF(1x14)W(18x14)JDKAOKYPNNXQMDKKGX(7x2)IHUZYBL(73x4)(9x5)FOVTPBVAV(13x9)EARZLZXSPEGWQ(3x3)QAR(11x12)TWJVZZSODUV(9x5)CGFVAEEEH(90x15)(11x9)YWKHVDSVGUO(12x10)GENMNJXISQVW(12x10)KBTDARSOPYAQ(14x3)NHGNNHWJAAESBB(9x10)CJIVXCNIZ(17x5)(2x10)VL(4x1)SSQH(430x7)(202x4)(1x10)O(187x11)(4x3)LYVC(94x5)(2x11)YL(37x5)PKLWZVRFRDJNMQUYXZZOGBUCFEGKARHPZRWLH(12x4)GJTFJWUZZGDJ(11x12)PQYMGSOEGFN(1x11)E(13x6)SMCPDDOIVMUJG(43x7)(19x1)ARSZUFFVAWVUVVAJYZG(11x10)DBEQVCPRXFZ(4x13)CILW(19x14)SOMYRGMAZBGXXSSVQQT(188x1)(2x7)OJ(19x1)(4x14)NIUS(4x5)MZXK(149x5)(5x15)XJJFF(9x3)WTNULIFAC(3x4)IEG(6x14)BUUOSC(97x15)(3x7)JDE(21x14)DRSIEZJSCSARMYNLHBXMA(6x6)KLXKVG(23x10)GWFKMOJCXJAZQRPYSIOJJMX(14x8)UVPDUFZQCLWMRY(1041x14)(487x4)(147x5)(18x5)(3x3)IEG(5x3)ORYNF(39x10)(2x9)ST(7x3)CNEFQLW(5x1)DWNFO(4x10)MENC(71x7)(10x4)WPXANNVOAW(9x14)HMVITPUDJ(2x12)ED(19x12)QFRXEDUDYNRCRGIQACU(1x4)G(153x2)(2x6)YX(35x7)(3x14)UFH(6x6)JKPPKO(2x14)NJ(2x7)UD(80x15)(1x12)W(5x13)TLUOY(12x13)OGETDQFVRFHB(30x10)VXWLNWQFZIBHSHJFUVXGMWQKRTPUNW(1x5)B(2x10)XJ(5x2)FLSQR(86x15)(64x9)(12x13)FWBFVBRJLSFO(9x10)ZPRGOCGIY(1x4)B(17x10)GLFZZASOWKMWKPDTX(10x8)CAFLEOCKCZ(54x2)(10x8)GGUJBSQXKH(1x13)K(11x2)XMEFKFUWGKB(9x4)AUZEFUEAN(13x14)VXYFVIJSRAVZZ(223x1)(104x2)(81x14)(29x6)IKMHIQWEIAZRBLNRYIQEOGFYMUCEE(3x12)NEU(20x15)RSUTWKPGWJJVIUDYXASE(5x1)YWRMT(10x3)VQUXAKOZAF(105x4)(2x3)AW(7x13)DJVQXBD(20x13)(9x4)DXROACCWK(1x4)O(26x13)(1x5)H(13x14)SBMKWBSXIQTUZ(19x5)GSHERQSGPSGZSAAODTO(309x10)(15x14)DNIEMCZLWCGEGSR(109x4)(1x14)G(45x5)(7x5)JTGEPNX(7x13)CNJHWWK(13x12)KJWMEKGRJRMQY(44x11)(9x15)OGVNXLNGE(16x11)NHPXBCXLHBHZSAQB(1x4)L(93x4)(7x12)(2x3)OB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(214x14)(5x6)ICUDF(48x12)(31x7)(2x10)TP(7x10)WZVHLAL(5x7)KSICH(5x15)FVQMZ(7x6)AXHHPXQ(130x8)(11x14)PVOXSOISUKL(62x11)(10x14)HGAHGPYOTZ(9x14)XATSJXSGN(3x13)UHW(7x5)BDFILVO(3x15)GMG(37x8)(3x12)AMM(6x6)LOPLLX(10x10)YFQHLBVIMU(228x4)(196x6)(72x8)(2x8)UY(12x5)SBLKPHOBOVFN(11x15)WLTYGTOAQWA(11x15)RMCCQHSJLXA(6x9)YMIKNU(50x5)(3x1)UTD(15x1)ZQIGJQRVLIHWAXA(9x2)DEJZUYIAL(1x10)N(55x13)(2x5)JX(9x11)HIBOQBDTQ(3x15)DZW(18x4)EWTFFMXDRUKNAPRHRA(8x1)YWZNRIBZ(6x14)IYSFIN(355x14)(194x12)(69x8)(3x3)JWI(11x1)MWECPWERVLX(25x15)YETRDSRTQWJVQLUJMBAPEDYJS(7x3)ITRTVHQ(10x10)LCXBZSSHTD(2x15)YF(53x1)(7x5)NOKQXWK(9x14)KZWHIQACE(5x1)YYBBF(10x2)TIVHXKIADG(29x5)(2x11)WH(1x12)O(1x3)J(3x3)DMD(146x1)(103x14)(3x3)ERJ(38x9)GNCTOAYQMPVNQRIVMPVHFSSSGJJSSKSIDALFXX(4x1)NCQT(3x14)LET(26x14)TFTZFNESHNZTQJXXYBMSRWGAGO(28x15)(21x13)GRQXOPFOMEVVQLSLETKMP(868x8)(2x2)LQ(413x10)(16x4)BJDCAOAWPRKTUFRC(31x15)LHSNRKFAVXIRZAKFIYGXZPTCIRUNZHG(193x3)(121x4)(2x6)WL(18x5)MXOBIDOXCQZZZQZXYC(5x10)RNAJG(38x3)QVEWABIGEWSUMFJYHZQLBTEDHDFIYFVMXHCRRE(28x11)VQEPBWKREZPTIZFUUNGEMZMXHFZS(59x9)(4x12)NCCS(19x9)JYSMUMHFWZFPABRIEEA(9x8)UFKXIDPNI(5x6)SGDUG(146x4)(28x5)GQKNGDPHQEJTRWPEVQJYFFIQYYPF(28x4)(15x10)AWEFQWTZFCCLXKE(1x7)M(13x8)QBKRCQRRBJDAE(53x1)WANGCZVVKGDRBZQRAVCUZMMCGNJNSHNFXANYREMTHLBUQGGZHSHHA(17x13)(3x11)BXL(3x8)RNJ(359x12)(17x1)(10x14)VPPYMRFSRU(207x4)(90x2)(21x14)VUDTSKRNATYRMYKGYQYDL(36x9)LDLIDFVHNZNTJTSSEYXDGRVODTLKEEZNOLFF(1x7)X(9x4)MGCIKCCSN(10x6)FPZMNVWKXH(24x13)OUBLSXEEYBRLOLVGZDQWDLRS(58x1)(23x13)WINJZLMDVRARNTFALJISNQK(4x4)QSQK(12x10)UPGRXOKUXTDM(115x9)(2x2)HO(21x1)(8x6)PCXYREJW(3x1)UWY(57x15)(6x4)QYSTVV(12x13)VRHZQVQAUZZX(2x10)DE(3x8)VGE(6x9)NXXMWM(10x15)MIENAJJIIE(43x8)YVIJLFYFOEQGUPNDWTRHDCLNVFGHIAPANTFZAMFGJQC(327x7)(3x11)ALX(311x1)(231x11)(25x11)RGXIXRXCNBRIFYSSQBKJXMASC(47x6)(8x12)OIQIUAOX(4x12)IILJ(17x7)NXBRGOKPSBULLIBXL(70x2)(11x9)GARFKGTCOJL(10x2)DXLRJCFRLN(17x12)FLZSXBDSLPOPDFFEM(7x12)PHEQJMO(5x3)JDOEM(54x4)(2x1)TD(3x4)YSO(2x14)YK(17x3)SSRTVCFNRLIKNOFRP(2x12)HB(24x1)(18x4)AZJCRZPJNIDEXSAGWI(1x15)Y(15x12)SPBYIMRXHEWUTGI(8x1)TGFEVRJD(126x12)(119x4)(6x4)AQOOFZ(101x7)(59x10)(22x12)SJEEKAXVKZYKJCXXAWWNEG(8x12)WGKCHMBP(2x10)KQ(3x6)MYL(2x6)VA(7x9)(1x11)K(2x3)RV(4x2)GIJL(441x15)(408x13)(289x8)(43x2)(6x9)BQAZCP(7x13)IZBNZQI(5x13)ZGMYF(3x4)GMZ(78x1)(15x12)DNXKBBTWSCRPEML(23x10)WAYXCNEKHTIISDIQEWGDCNF(4x10)XQRB(10x3)OISRGHWVVU(65x7)(8x15)KIFIOIVA(10x12)WKMUSFSYTC(1x12)U(8x11)JSNCQHWS(8x4)HYCCNHFC(10x8)(4x13)BQCN(63x2)(3x2)QGR(9x12)TOXGGUVRN(3x7)COD(25x14)CMLKONRWTLWLVWYUUEPWSBTEZ(72x8)(19x12)ARIOAFCAISJRQDMDHOF(24x7)HGLXAYCAYXGUWPYTOXGQZWLY(10x1)(5x6)PRJUZ(8x9)(2x12)BH(9x5)(3x11)MXX(2x1)XJ(19x8)HNLSLARKZVSCFTEXCSI(13x2)JVOICRNXKBEJW(2422x8)(10x15)JYSIQCFZOH(2369x9)(17x3)BWRHXTCEWMIOWCBLZ(1509x13)(570x6)(246x14)(60x11)(1x10)P(3x11)HKJ(8x15)IWETKXOI(5x8)NEADO(14x1)IEAVMTLUXBXBDE(8x15)QBBQUNOR(51x4)(45x4)YCCREIRLYPDFFQVRVJLOXIKRTRMDMBKIRVKHITINOULDG(15x4)WIDWCKTMYZPSREB(80x10)(7x15)ZVNHHAM(3x7)BHZ(25x1)PFVLKTHEUATHNNGXYDZGIJIBK(16x3)LUTCOWZBFVHJTUBK(1x9)K(190x15)(14x4)YXOTSDWQOJIVDW(53x11)(3x13)CSD(5x12)SDBDT(27x7)YDOBGKBLGCECQIVSRGFGIIJBWGA(30x7)(3x2)JDT(16x9)SFFCTBDYOVMUKMPL(51x5)(1x8)E(4x3)BITK(15x7)FLWVPMCSZRMVWYV(9x15)EIJVRIWJA(11x8)CSGGGGATSAO(83x15)(68x11)(14x2)LLJVOPOHENDLAQ(3x7)DVN(2x3)YS(11x3)XSBUFRQPHOY(10x9)WVHAUYCVEB(2x13)OR(6x10)OSFCFB(10x6)OBBFPHGWAQ(30x4)EXARKTZXSTLIHCZZRQACWOPVJKZGSK(394x5)(86x10)(9x10)(4x4)YPKF(16x12)(10x5)AVCMULTYPH(28x5)(8x9)WRCBEQLZ(9x10)FDNRGFFOE(8x14)LANMMNWZ(47x10)(31x10)(1x6)V(2x3)RV(6x9)YUCWZK(1x11)B(4x6)EVKQ(30x6)(17x6)(6x5)QKMAXX(1x1)R(2x8)LC(204x2)(13x13)(7x11)BANBCOT(81x7)(2x10)BK(56x7)WBGFHSLVALLDLXHGVCQOAHKOFKAEVQOKSVRBIGNGGIYDVXVWOQUTUEMM(5x10)XGTUJ(58x13)(5x3)ZQYHT(14x4)ZZGNGNSJKPSGRQ(3x8)AKN(4x6)RXLZ(6x2)WEEFXH(25x11)TJFFJBAAGGOBSAZQMQUICAHYI(236x9)(194x15)(3x14)JVA(35x11)(11x2)GQGINADTCQS(11x12)RTIRLMBRRJH(61x10)(7x13)CBWDCZV(7x10)JVCBFYH(1x12)H(13x3)UGATYZUHDCEYZ(3x12)OVG(7x7)EIACOSC(56x12)(27x10)YNDHNMITCLTBYSXPTQUTOUCQIXT(15x13)MUOBITUAHZJSRFK(27x10)(14x12)LXCRVIHJNXRIBA(1x6)K(244x13)(25x5)(6x11)(1x4)T(7x10)SRNQHTE(86x10)(14x9)VWOSJAUKGACGWY(22x12)IOCFRYWTITQHRWWRGQVYDN(14x4)PFETLTSAJBRKLD(10x10)OJCWMEHWKB(50x13)(44x9)(26x1)JXVEVGQUOGOOUTKSOEJYVUBIQB(6x14)ZLEVWS(57x8)(23x4)LYXFADIWRECSPOFSVZNGBHV(21x13)CKUEOYZWLZRXIMLRNIUXP(820x13)(261x1)(144x11)(1x5)E(64x1)(18x13)FCVQICIADHEWSQXHWE(26x5)XXKJGNVZWFOVTEYUREEFCHICDM(2x5)HK(15x11)(3x10)ORP(1x8)C(39x11)(4x13)SUFP(22x10)KYQUIAWLMRKSIOWRBRDWWZ(27x6)(21x6)(5x14)GPQTG(5x2)OPMFU(1x14)X(63x3)(57x4)(6x1)IQFWVT(23x14)AVBLZTVEXGPWRROBTUNYYNI(10x4)DTKMOIKVHV(297x13)(134x14)(2x11)HZ(46x4)(16x4)VZZRZCXCXQRURHKS(11x11)VUEMWTKDREM(1x9)U(35x3)(6x11)YNEWZL(16x12)QMHAUQCYJZCYLMND(13x1)VREYZNFSUNKMO(8x13)RLWWXNXA(13x13)EGENXEUKVVSUI(31x5)(3x2)PGY(3x15)RWD(8x15)YRNZQEBO(16x6)(10x9)(4x10)VLXQ(70x3)(6x8)TNVWPK(1x2)A(46x12)(7x9)HGHIFJD(3x9)JAK(19x11)CCNIXNDAIXLLURONAJM(4x6)GFMK(231x9)(187x6)(16x12)KLYAJFBPAXQIVSLJ(4x13)KHJZ(61x5)(23x1)WMHPHZFOQDFEBWBLYWHUVYD(17x13)AGOTHNZXFDKTSOWER(3x9)OEK(37x9)(6x2)ZWBDUY(2x3)DK(12x15)JDHDZQWPZOJU(38x1)(4x6)NGKF(1x15)I(16x5)VYLULCVBLWHGFXWU(6x5)DBKVCG(11x11)JZESDFRQABC(3x9)KDK(10x1)(4x13)AABI(7x5)KLEGJFL(10x5)(4x15)ZWUS(8x2)QFDRMQGB(13x6)(8x5)(3x8)CGU(20x3)SRQEHKTTHHVEZBPBXYLJ(3x12)BUI(27x2)(21x8)(7x12)IVFOQOK(3x5)HAG(45x15)PZDPOLVYNVIARZUFYFYFSCRUBGUYFOIPJFWRQBFNPTTTU(26x13)(3x6)AGP(3x11)ROD(3x13)HAW(63x6)(2x10)TO(29x12)VCQIALMPBPWQRPGGDTYLIDVQJBVND(13x9)(8x8)UUNJYCJW diff --git a/src/2017/day9/README.md b/src/2017/day9/README.md index e69de29..c57880c 100644 --- a/src/2017/day9/README.md +++ b/src/2017/day9/README.md @@ -0,0 +1,42 @@ +--- Day 9: Stream Processing --- +A large stream blocks your path. According to the locals, it's not safe to cross the stream at the moment because it's full of garbage. You look down at the stream; rather than water, you discover that it's a stream of characters. + +You sit for a while and record part of the stream (your puzzle input). The characters represent groups - sequences that begin with { and end with }. Within a group, there are zero or more other things, separated by commas: either another group or garbage. Since groups can contain other groups, a } only closes the most-recently-opened unclosed group - that is, they are nestable. Your puzzle input represents a single, large group which itself contains many smaller ones. + +Sometimes, instead of a group, you will find garbage. Garbage begins with < and ends with >. Between those angle brackets, almost any character can appear, including { and }. Within garbage, < has no special meaning. + +In a futile attempt to clean up the garbage, some program has canceled some of the characters within it using !: inside garbage, any character that comes after ! should be ignored, including <, >, and even another !. + +You don't see any characters that deviate from these rules. Outside garbage, you only find well-formed groups, and garbage always terminates according to the rules above. + +Here are some self-contained pieces of garbage: + +<>, empty garbage. +<random characters>, garbage containing random characters. +<<<<>, because the extra < are ignored. +<{!>}>, because the first > is canceled. +<!!>, because the second ! is canceled, allowing the > to terminate the garbage. +<!!!>>, because the second ! and the first > are canceled. +<{o"i!a,<{i<a>, which ends at the first >. +Here are some examples of whole streams and the number of groups they contain: + +{}, 1 group. +{{{}}}, 3 groups. +{{},{}}, also 3 groups. +{{{},{},{{}}}}, 6 groups. +{<{},{},{{}}>}, 1 group (which itself contains garbage). +{<a>,<a>,<a>,<a>}, 1 group. +{{<a>},{<a>},{<a>},{<a>}}, 5 groups. +{{<!>},{<!>},{<!>},{<a>}}, 2 groups (since all but the last > are canceled). +Your goal is to find the total score for all groups in your input. Each group is assigned a score which is one more than the score of the group that immediately contains it. (The outermost group gets a score of 1.) + +{}, score of 1. +{{{}}}, score of 1 + 2 + 3 = 6. +{{},{}}, score of 1 + 2 + 2 = 5. +{{{},{},{{}}}}, score of 1 + 2 + 3 + 3 + 3 + 4 = 16. +{<a>,<a>,<a>,<a>}, score of 1. +{{<ab>},{<ab>},{<ab>},{<ab>}}, score of 1 + 2 + 2 + 2 + 2 = 9. +{{<!!>},{<!!>},{<!!>},{<!!>}}, score of 1 + 2 + 2 + 2 + 2 = 9. +{{<a!>},{<a!>},{<a!>},{<ab>}}, score of 1 + 2 = 3. +What is the total score for all groups in your input? + diff --git a/src/2017/day9/input b/src/2017/day9/input index e69de29..d89a1b0 100644 --- a/src/2017/day9/input +++ b/src/2017/day9/input @@ -0,0 +1 @@ +{{{{{<!!!>},<!e!!!'ue!o!!!>"o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2018/day9/README.md b/src/2018/day9/README.md index e69de29..04805aa 100644 --- a/src/2018/day9/README.md +++ b/src/2018/day9/README.md @@ -0,0 +1,50 @@ +--- Day 9: Marble Mania --- +You talk to the Elves while you wait for your navigation system to initialize. To pass the time, they introduce you to their favorite marble game. + +The Elves play this game by taking turns arranging the marbles in a circle according to very particular rules. The marbles are numbered starting with 0 and increasing by 1 until every marble has a number. + +First, the marble numbered 0 is placed in the circle. At this point, while it contains only a single marble, it is still a circle: the marble is both clockwise from itself and counter-clockwise from itself. This marble is designated the current marble. + +Then, each Elf takes a turn placing the lowest-numbered remaining marble into the circle between the marbles that are 1 and 2 marbles clockwise of the current marble. (When the circle is large enough, this means that there is one marble between the marble that was just placed and the current marble.) The marble that was just placed then becomes the current marble. + +However, if the marble that is about to be placed has a number which is a multiple of 23, something entirely different happens. First, the current player keeps the marble they would have placed, adding it to their score. In addition, the marble 7 marbles counter-clockwise from the current marble is removed from the circle and also added to the current player's score. The marble located immediately clockwise of the marble that was removed becomes the new current marble. + +For example, suppose there are 9 players. After the marble with value 0 is placed in the middle, each player (shown in square brackets) takes a turn. The result of each of those turns would produce circles of marbles like this, where clockwise is to the right and the resulting current marble is in parentheses: + +[-] (0) +[1] 0 (1) +[2] 0 (2) 1 +[3] 0 2 1 (3) +[4] 0 (4) 2 1 3 +[5] 0 4 2 (5) 1 3 +[6] 0 4 2 5 1 (6) 3 +[7] 0 4 2 5 1 6 3 (7) +[8] 0 (8) 4 2 5 1 6 3 7 +[9] 0 8 4 (9) 2 5 1 6 3 7 +[1] 0 8 4 9 2(10) 5 1 6 3 7 +[2] 0 8 4 9 2 10 5(11) 1 6 3 7 +[3] 0 8 4 9 2 10 5 11 1(12) 6 3 7 +[4] 0 8 4 9 2 10 5 11 1 12 6(13) 3 7 +[5] 0 8 4 9 2 10 5 11 1 12 6 13 3(14) 7 +[6] 0 8 4 9 2 10 5 11 1 12 6 13 3 14 7(15) +[7] 0(16) 8 4 9 2 10 5 11 1 12 6 13 3 14 7 15 +[8] 0 16 8(17) 4 9 2 10 5 11 1 12 6 13 3 14 7 15 +[9] 0 16 8 17 4(18) 9 2 10 5 11 1 12 6 13 3 14 7 15 +[1] 0 16 8 17 4 18 9(19) 2 10 5 11 1 12 6 13 3 14 7 15 +[2] 0 16 8 17 4 18 9 19 2(20)10 5 11 1 12 6 13 3 14 7 15 +[3] 0 16 8 17 4 18 9 19 2 20 10(21) 5 11 1 12 6 13 3 14 7 15 +[4] 0 16 8 17 4 18 9 19 2 20 10 21 5(22)11 1 12 6 13 3 14 7 15 +[5] 0 16 8 17 4 18(19) 2 20 10 21 5 22 11 1 12 6 13 3 14 7 15 +[6] 0 16 8 17 4 18 19 2(24)20 10 21 5 22 11 1 12 6 13 3 14 7 15 +[7] 0 16 8 17 4 18 19 2 24 20(25)10 21 5 22 11 1 12 6 13 3 14 7 15 +The goal is to be the player with the highest score after the last marble is used up. Assuming the example above ends after the marble numbered 25, the winning score is 23+9=32 (because player 5 kept marble 23 and removed marble 9, while no other player got any points in this very short example game). + +Here are a few more examples: + +10 players; last marble is worth 1618 points: high score is 8317 +13 players; last marble is worth 7999 points: high score is 146373 +17 players; last marble is worth 1104 points: high score is 2764 +21 players; last marble is worth 6111 points: high score is 54718 +30 players; last marble is worth 5807 points: high score is 37305 +What is the winning Elf's score? + diff --git a/src/2018/day9/input b/src/2018/day9/input index e69de29..b2a770e 100644 --- a/src/2018/day9/input +++ b/src/2018/day9/input @@ -0,0 +1 @@ +411 players; last marble is worth 71170 points diff --git a/src/2019/day9/README.md b/src/2019/day9/README.md index e69de29..ab16434 100644 --- a/src/2019/day9/README.md +++ b/src/2019/day9/README.md @@ -0,0 +1,35 @@ +--- Day 9: Sensor Boost --- +You've just said goodbye to the rebooted rover and left Mars when you receive a faint distress signal coming from the asteroid belt. It must be the Ceres monitoring station! + +In order to lock on to the signal, you'll need to boost your sensors. The Elves send up the latest BOOST program - Basic Operation Of System Test. + +While BOOST (your puzzle input) is capable of boosting your sensors, for tenuous safety reasons, it refuses to do so until the computer it runs on passes some checks to demonstrate it is a complete Intcode computer. + +Your existing Intcode computer is missing one key feature: it needs support for parameters in relative mode. + +Parameters in mode 2, relative mode, behave very similarly to parameters in position mode: the parameter is interpreted as a position. Like position mode, parameters in relative mode can be read from or written to. + +The important difference is that relative mode parameters don't count from address 0. Instead, they count from a value called the relative base. The relative base starts at 0. + +The address a relative mode parameter refers to is itself plus the current relative base. When the relative base is 0, relative mode parameters and position mode parameters with the same value refer to the same address. + +For example, given a relative base of 50, a relative mode parameter of -7 refers to memory address 50 + -7 = 43. + +The relative base is modified with the relative base offset instruction: + +Opcode 9 adjusts the relative base by the value of its only parameter. The relative base increases (or decreases, if the value is negative) by the value of the parameter. +For example, if the relative base is 2000, then after the instruction 109,19, the relative base would be 2019. If the next instruction were 204,-34, then the value at address 1985 would be output. + +Your Intcode computer will also need a few other capabilities: + +The computer's available memory should be much larger than the initial program. Memory beyond the initial program starts with the value 0 and can be read or written like any other memory. (It is invalid to try to access memory at a negative address, though.) +The computer should have support for large numbers. Some instructions near the beginning of the BOOST program will verify this capability. +Here are some example programs that use these features: + +109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99 takes no input and produces a copy of itself as output. +1102,34915192,34915192,7,4,7,99,0 should output a 16-digit number. +104,1125899906842624,99 should output the large number in the middle. +The BOOST program will ask for a single input; run it in test mode by providing it the value 1. It will perform a series of checks on each opcode, output any opcodes (and the associated parameter modes) that seem to be functioning incorrectly, and finally output a BOOST keycode. + +Once your Intcode computer is fully functional, the BOOST program should report no malfunctioning opcodes when run in test mode; it should only output a single value, the BOOST keycode. What BOOST keycode does it produce? + diff --git a/src/2019/day9/input b/src/2019/day9/input index e69de29..f190a71 100644 --- a/src/2019/day9/input +++ b/src/2019/day9/input @@ -0,0 +1 @@ +1102,34463338,34463338,63,1007,63,34463338,63,1005,63,53,1102,1,3,1000,109,988,209,12,9,1000,209,6,209,3,203,0,1008,1000,1,63,1005,63,65,1008,1000,2,63,1005,63,904,1008,1000,0,63,1005,63,58,4,25,104,0,99,4,0,104,0,99,4,17,104,0,99,0,0,1102,1,1,1021,1101,0,21,1009,1101,0,28,1005,1102,1,27,1015,1102,39,1,1016,1102,1,30,1003,1102,25,1,1007,1102,195,1,1028,1101,0,29,1010,1102,26,1,1004,1102,1,555,1024,1102,32,1,1014,1101,0,23,1019,1102,1,31,1008,1101,652,0,1023,1102,20,1,1000,1101,0,821,1026,1102,814,1,1027,1102,1,36,1017,1101,0,38,1006,1102,1,37,1011,1102,33,1,1001,1102,35,1,1013,1102,190,1,1029,1102,1,22,1018,1101,0,0,1020,1102,1,34,1012,1102,24,1,1002,1101,0,655,1022,1102,1,546,1025,109,37,2106,0,-9,4,187,1106,0,199,1001,64,1,64,1002,64,2,64,109,-32,1202,1,1,63,1008,63,38,63,1005,63,225,4,205,1001,64,1,64,1106,0,225,1002,64,2,64,109,6,1206,10,241,1001,64,1,64,1106,0,243,4,231,1002,64,2,64,109,-12,1207,2,32,63,1005,63,259,1106,0,265,4,249,1001,64,1,64,1002,64,2,64,109,2,2101,0,0,63,1008,63,33,63,1005,63,291,4,271,1001,64,1,64,1106,0,291,1002,64,2,64,109,21,1205,-1,305,4,297,1106,0,309,1001,64,1,64,1002,64,2,64,109,-10,2108,29,-7,63,1005,63,329,1001,64,1,64,1106,0,331,4,315,1002,64,2,64,109,-15,2107,26,10,63,1005,63,347,1106,0,353,4,337,1001,64,1,64,1002,64,2,64,109,13,21107,40,41,2,1005,1012,375,4,359,1001,64,1,64,1106,0,375,1002,64,2,64,109,7,21107,41,40,-5,1005,1012,391,1105,1,397,4,381,1001,64,1,64,1002,64,2,64,109,-6,21102,42,1,2,1008,1013,40,63,1005,63,421,1001,64,1,64,1105,1,423,4,403,1002,64,2,64,109,-10,2107,23,1,63,1005,63,441,4,429,1105,1,445,1001,64,1,64,1002,64,2,64,109,3,1201,5,0,63,1008,63,21,63,1005,63,467,4,451,1106,0,471,1001,64,1,64,1002,64,2,64,109,18,21108,43,43,-5,1005,1017,489,4,477,1105,1,493,1001,64,1,64,1002,64,2,64,109,-29,1207,7,21,63,1005,63,511,4,499,1106,0,515,1001,64,1,64,1002,64,2,64,109,23,21108,44,46,-6,1005,1010,531,1106,0,537,4,521,1001,64,1,64,1002,64,2,64,109,11,2105,1,-3,4,543,1001,64,1,64,1106,0,555,1002,64,2,64,109,-3,1205,-4,571,1001,64,1,64,1105,1,573,4,561,1002,64,2,64,109,-7,2108,21,-8,63,1005,63,595,4,579,1001,64,1,64,1105,1,595,1002,64,2,64,109,-1,1208,-8,28,63,1005,63,615,1001,64,1,64,1106,0,617,4,601,1002,64,2,64,109,-12,1202,4,1,63,1008,63,29,63,1005,63,641,1001,64,1,64,1106,0,643,4,623,1002,64,2,64,109,18,2105,1,1,1105,1,661,4,649,1001,64,1,64,1002,64,2,64,109,-6,2102,1,-8,63,1008,63,31,63,1005,63,687,4,667,1001,64,1,64,1106,0,687,1002,64,2,64,109,-7,21102,45,1,6,1008,1015,45,63,1005,63,709,4,693,1106,0,713,1001,64,1,64,1002,64,2,64,109,-6,2101,0,0,63,1008,63,31,63,1005,63,737,1001,64,1,64,1105,1,739,4,719,1002,64,2,64,109,7,1208,-8,24,63,1005,63,761,4,745,1001,64,1,64,1105,1,761,1002,64,2,64,109,-12,2102,1,10,63,1008,63,32,63,1005,63,781,1106,0,787,4,767,1001,64,1,64,1002,64,2,64,109,16,1206,6,801,4,793,1106,0,805,1001,64,1,64,1002,64,2,64,109,14,2106,0,-1,1001,64,1,64,1106,0,823,4,811,1002,64,2,64,109,-18,1201,-7,0,63,1008,63,27,63,1005,63,847,1001,64,1,64,1105,1,849,4,829,1002,64,2,64,109,-8,21101,46,0,10,1008,1012,46,63,1005,63,875,4,855,1001,64,1,64,1106,0,875,1002,64,2,64,109,13,21101,47,0,-3,1008,1012,44,63,1005,63,899,1001,64,1,64,1105,1,901,4,881,4,64,99,21101,27,0,1,21102,1,915,0,1105,1,922,21201,1,11564,1,204,1,99,109,3,1207,-2,3,63,1005,63,964,21201,-2,-1,1,21101,942,0,0,1105,1,922,22101,0,1,-1,21201,-2,-3,1,21101,0,957,0,1106,0,922,22201,1,-1,-2,1105,1,968,21202,-2,1,-2,109,-3,2105,1,0 diff --git a/src/2020/day9/README.md b/src/2020/day9/README.md index e69de29..e75d0d9 100644 --- a/src/2020/day9/README.md +++ b/src/2020/day9/README.md @@ -0,0 +1,46 @@ +--- Day 9: Encoding Error --- +With your neighbor happily enjoying their video game, you turn your attention to an open data port on the little screen in the seat in front of you. + +Though the port is non-standard, you manage to connect it to your computer through the clever use of several paperclips. Upon connection, the port outputs a series of numbers (your puzzle input). + +The data appears to be encrypted with the eXchange-Masking Addition System (XMAS) which, conveniently for you, is an old cypher with an important weakness. + +XMAS starts by transmitting a preamble of 25 numbers. After that, each number you receive should be the sum of any two of the 25 immediately previous numbers. The two numbers will have different values, and there might be more than one such pair. + +For example, suppose your preamble consists of the numbers 1 through 25 in a random order. To be valid, the next number must be the sum of two of those numbers: + +26 would be a valid next number, as it could be 1 plus 25 (or many other pairs, like 2 and 24). +49 would be a valid next number, as it is the sum of 24 and 25. +100 would not be valid; no two of the previous 25 numbers sum to 100. +50 would also not be valid; although 25 appears in the previous 25 numbers, the two numbers in the pair must be different. +Suppose the 26th number is 45, and the first number (no longer an option, as it is more than 25 numbers ago) was 20. Now, for the next number to be valid, there needs to be some pair of numbers among 1-19, 21-25, or 45 that add up to it: + +26 would still be a valid next number, as 1 and 25 are still within the previous 25 numbers. +65 would not be valid, as no two of the available numbers sum to it. +64 and 66 would both be valid, as they are the result of 19+45 and 21+45 respectively. +Here is a larger example which only considers the previous 5 numbers (and has a preamble of length 5): + +35 +20 +15 +25 +47 +40 +62 +55 +65 +95 +102 +117 +150 +182 +127 +219 +299 +277 +309 +576 +In this example, after the 5-number preamble, almost every number is the sum of two of the previous 5 numbers; the only number that does not follow this rule is 127. + +The first step of attacking the weakness in the XMAS data is to find the first number in the list (after the preamble) which is not the sum of two of the 25 numbers before it. What is the first number that does not have this property? + diff --git a/src/2020/day9/input b/src/2020/day9/input index e69de29..7b2d3c5 100644 --- a/src/2020/day9/input +++ b/src/2020/day9/input @@ -0,0 +1,1000 @@ +14 +39 +44 +32 +47 +15 +16 +42 +35 +41 +4 +23 +24 +11 +12 +21 +2 +26 +43 +9 +38 +3 +1 +8 +20 +33 +5 +6 +7 +49 +18 +10 +16 +19 +13 +15 +31 +41 +65 +44 +11 +34 +4 +12 +14 +23 +9 +56 +17 +21 +20 +22 +24 +25 +26 +27 +18 +28 +16 +19 +13 +32 +15 +29 +30 +33 +39 +31 +34 +55 +51 +53 +38 +35 +36 +37 +64 +44 +40 +41 +42 +45 +43 +28 +46 +48 +83 +81 +71 +66 +59 +102 +62 +118 +72 +121 +63 +75 +65 +68 +69 +70 +73 +74 +76 +99 +89 +103 +87 +94 +107 +142 +122 +191 +124 +125 +127 +128 +131 +137 +132 +133 +167 +134 +141 +139 +146 +176 +304 +213 +181 +194 +309 +201 +247 +232 +246 +250 +249 +251 +256 +255 +354 +279 +266 +300 +267 +308 +273 +280 +285 +370 +357 +375 +382 +443 +395 +506 +433 +619 +650 +495 +499 +874 +651 +563 +930 +533 +539 +546 +540 +581 +553 +648 +565 +718 +770 +732 +757 +828 +838 +928 +932 +966 +994 +1407 +1028 +1032 +1335 +1073 +1072 +1079 +1251 +1085 +1086 +1093 +1575 +1576 +2008 +1283 +1488 +1570 +1489 +2567 +2045 +1770 +1860 +1898 +2217 +2022 +2151 +2060 +2655 +2145 +2158 +2157 +4374 +2368 +4218 +2179 +2376 +2771 +2772 +2853 +3058 +2977 +3059 +3259 +3958 +3630 +3668 +4049 +4794 +4082 +4167 +4205 +4217 +4302 +4303 +4336 +5215 +6581 +4547 +5438 +5032 +5147 +5543 +5625 +6318 +6035 +6036 +6689 +6889 +9293 +7298 +7970 +8131 +9249 +8249 +8553 +11192 +8519 +12514 +11063 +13796 +9579 +9694 +9985 +14792 +19616 +13756 +11168 +11660 +12071 +12724 +12925 +13578 +14187 +15268 +16684 +16101 +16380 +17802 +28344 +17072 +34408 +18098 +19273 +28370 +19564 +19679 +21354 +27112 +22828 +25649 +23239 +24585 +26911 +31676 +26302 +26503 +27765 +29455 +42392 +32481 +33173 +34182 +35900 +35170 +36345 +53268 +62071 +49724 +39243 +40918 +44264 +44182 +46067 +51004 +47824 +51088 +50887 +52805 +58783 +54067 +98872 +68343 +61936 +114876 +89613 +143136 +90642 +72245 +98249 +119347 +149425 +90249 +218219 +266043 +271024 +88446 +100134 +93891 +98711 +100629 +109871 +324826 +106872 +112850 +231582 +190242 +130279 +134181 +162887 +160691 +162494 +170494 +212984 +332331 +422580 +495218 +178695 +182337 +279324 +222627 +188580 +261320 +194520 +199340 +216743 +288566 +219722 +392174 +374170 +401322 +264460 +290970 +596791 +323185 +665782 +493679 +373215 +455840 +361032 +393860 +449900 +370917 +376857 +405323 +483086 +383100 +572555 +411263 +621044 +510692 +484182 +696400 +587645 +647560 +555430 +669783 +661887 +731949 +684217 +767075 +734247 +861163 +747774 +737889 +754017 +960753 +759957 +782180 +889505 +794363 +867282 +895445 +1081046 +994874 +1039612 +1071827 +1143075 +1239647 +1385449 +1217317 +1331670 +1346104 +1438234 +1422106 +1472136 +2084599 +1485663 +1828820 +1520069 +2041799 +1542137 +1554320 +2696102 +2129152 +2010357 +1762727 +1890319 +2759716 +2034486 +2182687 +2214902 +2528524 +2781784 +2548987 +2639423 +2677774 +2860340 +3583936 +2894242 +3410388 +3702756 +3005732 +5618422 +3062206 +3317047 +4091124 +4139509 +3653046 +3797213 +4418843 +4105221 +4073006 +6261710 +4217173 +7355802 +4743426 +6380530 +5188410 +5226761 +5754582 +7866184 +6708488 +5899974 +6416120 +6067938 +7135212 +6322779 +6379253 +6715252 +7758267 +8244730 +8071889 +7450259 +9859803 +11159546 +10140944 +8290179 +10117147 +9405583 +9931836 +9970187 +10415171 +10942992 +11549540 +20258091 +13971863 +11967912 +12738899 +14706299 +17899211 +17865430 +12702032 +13094505 +14165511 +22561835 +17310062 +19265386 +17420446 +17695762 +18222015 +31392309 +19839719 +19337419 +34043718 +19902023 +20385358 +40097810 +25440931 +28871810 +32571729 +24669944 +36647481 +35300734 +22477624 +25796537 +27260016 +26867543 +30404567 +34005230 +34730508 +35005824 +54312741 +35116208 +44955778 +38061734 +39177138 +67687937 +40287381 +53541754 +55074511 +42862982 +63602318 +78982685 +47147568 +62444018 +49345167 +48274161 +49737640 +52664080 +80142207 +54127559 +57272110 +64409797 +69121438 +73067558 +70122032 +73177942 +74293346 +118859078 +78349115 +87451299 +95527062 +83150363 +132476674 +90010550 +91137143 +95421729 +145594381 +96885208 +97619328 +98011801 +100938241 +102401720 +106791639 +111399669 +154420347 +121681907 +133531235 +142188996 +144415378 +167007240 +147471288 +196359970 +165800414 +161499478 +173160913 +252039675 +174287506 +185432279 +334660391 +193041057 +259511279 +352977916 +203676847 +500449204 +198950042 +266097285 +209193359 +253588665 +233081576 +294842820 +399510963 +310215792 +347448419 +513248833 +370692837 +308970766 +642291239 +327299892 +335786984 +358593192 +359719785 +367328563 +394625638 +503256849 +402234416 +402626889 +412870206 +469774132 +560940105 +908388524 +442274935 +462782024 +486670241 +527924396 +656419185 +619186558 +772997816 +727048348 +636270658 +949452265 +644757750 +663086876 +687019677 +1310622940 +718312977 +928268668 +769955452 +807495844 +815497095 +804861305 +1021813447 +855145141 +905056959 +928945176 +1723885619 +970199331 +1191011272 +1014594637 +1172682146 +1255457216 +1615288345 +1452253594 +1281028408 +1299357534 +1307844626 +1331777427 +1625100593 +1405332654 +1646581645 +1488268429 +1574816757 +1577451296 +2896316753 +1834002135 +1660006446 +1760202100 +3337653396 +2991783873 +2554814750 +2787625963 +3978637235 +2187276783 +2270051853 +2428139362 +4984235041 +2588873034 +3239334789 +4520363197 +4132266046 +3148274875 +3051914299 +2893601083 +2982783950 +6041875958 +3063085186 +5321966152 +4214821196 +3420208546 +8935477041 +3847283229 +3947478883 +4457328636 +4615416145 +4698191215 +5080877866 +4776149817 +4858924887 +5017012396 +5321740445 +5482474117 +5571656984 +5876385033 +5945515382 +7350929719 +6841079966 +5956686269 +6045869136 +6402992496 +10499204594 +6483293732 +7267491775 +7367687429 +7794762112 +8304611865 +12922586703 +8404807519 +9072744781 +9313607360 +21327394222 +9939802753 +9635074704 +10180665332 +10338752841 +12359678765 +11054131101 +11448042017 +14281192552 +11902201651 +12002555405 +16295439110 +12439980001 +13670484271 +13770679925 +13750785507 +14635179204 +15062253887 +16099373977 +23413809866 +18485277197 +21942358158 +21075300186 +21387844770 +18948682064 +19574877457 +28425079950 +23305558975 +20519418173 +29933319214 +22502173118 +22956332752 +23350243668 +23904757056 +44425543854 +25753340912 +26110464272 +26190765508 +27421269778 +32255957122 +39513183843 +29697433091 +34637131344 +34584651174 +37433959261 +38060154654 +60827896852 +60588484029 +38523559521 +67381876606 +40094295630 +83544816781 +43021591291 +46861089808 +113478135995 +50015221328 +46306576420 +47255000724 +50095522564 +66840608296 +51944106420 +53531734050 +58446722630 +57118702869 +61953390213 +144372713633 +64282084265 +77606242465 +72018610435 +78154450284 +138434139317 +78617855151 +100392823858 +85384649329 +188449360645 +103979792677 +123962716855 +113701698104 +211213321929 +116936130860 +93561577144 +96402098984 +99199107144 +128249972848 +105475840470 +109062809289 +129137313304 +126235474478 +133972000648 +201155923739 +141888326730 +136300694700 +149624852900 +217328954718 +193954401002 +172179432295 +164002504480 +178946226473 +396275181191 +189963676128 +300429405143 +199037417614 +436730099843 +192760684288 +234613153774 +195601206128 +331015252758 +204674947614 +214538649759 +231711314948 +235298283767 +255372787782 +285925547600 +568454613486 +278189021430 +291513179630 +427373838062 +586388040540 +336181936775 +357956905482 +564114569030 +413559380247 +382724360416 +385564882256 +489985941556 +1132569182516 +517636862548 +388361890416 +622975044190 +469911437541 +400276153742 +587399308030 +490600495214 +446249964707 +467009598715 +569702201060 +541298335382 +577438727230 +743521787738 +773926772672 +761424617171 +1140611906738 +694138842257 +846526118449 +740681265898 +1077999803244 +768289242672 +771086250832 +1077385249586 +834611855123 +788638044158 +965800617646 +858273327957 +1292776083156 +1164838035260 +1351365499902 +1279238539372 +1060302696274 +913259563422 +1366076771388 +1754441538531 +1309587578054 +1423964845679 +1434820108155 +1455563459428 +1462428084929 +1559724294990 +1607398405679 +1587207384347 +2122451750734 +1539375493504 +1894914551397 +1684345814254 +2282238173636 +1623249899281 +1879060181068 +1973562259696 +2293093436112 +2078097598682 +2192498102794 +2916985983733 +3648314945024 +2222847141476 +2279336334810 +4505085315112 +3617473092186 +2744407686209 +2879528305107 +2890383567583 +2994938952932 +3001803578433 +4811900535130 +3512937753200 +3126582877851 +3307595713535 +3907192955730 +3657908073950 +4485591538906 +7033775833581 +6309399291968 +3852622440764 +4975365838129 +8623680783153 +6514741331633 +7977169416562 +5927651279834 +4502183476286 +7556308221339 +6197979281118 +5634791253792 +11618619736085 +11750263661004 +5769911872690 +5885322520515 +5996742531365 +6128386456284 +6434178591386 +6639520631051 +6965503787485 +7565101029680 +9541984209522 +9427819946640 +13441630741854 +8354805917050 +9477549314415 +8827988278893 +10387505996801 +10136974730078 +10429834756120 +14483192373334 +10272095348976 +11631533785157 +13999279621066 +11404703126482 +11520113774307 +11655234393205 +11766654404055 +11882065051880 +13561843561045 +15793492066378 +13073699222437 +13605024418536 +18159634405358 +17896790126572 +17837196378656 +21949948530427 +17782625863690 +20483222672098 +17182794195943 +21359614366295 +20659601345777 +23286768178362 +20409070079054 +22085069149325 +28431729754334 +21676798475458 +22924816900789 +23059937519687 +23171357530537 +23175348167512 +23421888797260 +23648719455935 +24955764274317 +30744637756988 +35019990574599 +39142240229985 +38819235751135 +48377653071577 +34965420059633 +35619822242346 +60904304900460 +37591864274997 +37666016868041 +37842395541720 +41068671424831 +71799541868837 diff --git a/src/2021/day9/README.md b/src/2021/day9/README.md index e69de29..205cc78 100644 --- a/src/2021/day9/README.md +++ b/src/2021/day9/README.md @@ -0,0 +1,22 @@ +--- Day 9: Smoke Basin --- +These caves seem to be lava tubes. Parts are even still volcanically active; small hydrothermal vents release smoke into the caves that slowly settles like rain. + +If you can model how the smoke flows through the caves, you might be able to avoid it and be that much safer. The submarine generates a heightmap of the floor of the nearby caves for you (your puzzle input). + +Smoke flows to the lowest point of the area it's in. For example, consider the following heightmap: + +2199943210 +3987894921 +9856789892 +8767896789 +9899965678 +Each number corresponds to the height of a particular location, where 9 is the highest and 0 is the lowest a location can be. + +Your first goal is to find the low points - the locations that are lower than any of its adjacent locations. Most locations have four adjacent locations (up, down, left, and right); locations on the edge or corner of the map have three or two adjacent locations, respectively. (Diagonal locations do not count as adjacent.) + +In the above example, there are four low points, all highlighted: two are in the first row (a 1 and a 0), one is in the third row (a 5), and one is in the bottom row (also a 5). All other locations on the heightmap have some lower adjacent location, and so are not low points. + +The risk level of a low point is 1 plus its height. In the above example, the risk levels of the low points are 2, 1, 6, and 6. The sum of the risk levels of all low points in the heightmap is therefore 15. + +Find all of the low points on your heightmap. What is the sum of the risk levels of all low points on your heightmap? + diff --git a/src/2021/day9/input b/src/2021/day9/input index e69de29..a24295d 100644 --- a/src/2021/day9/input +++ b/src/2021/day9/input @@ -0,0 +1,100 @@ +0198954334976942239109321545998999878998764656978999349899965478954987432389012356989932123998432123 +1997943129865890198998910239867899967999873249865988998799896567899876543478925689879899019896421012 +9886895997654789987987891998756898656987654598774877897545697878912988654567934598767688998789432123 +8765789869763567996545789876545999768998798797653656796536789989543499867688955697654567897678954235 +9876898753212456989434679987976789879239899898542348987421568997699989878999896898753656797569765376 +0987899854901345678923478998987999989998975959643459876542456789988978989998789999842349899678997487 +2398959769892957789012467899898999899897654345987678987543567999876767897987678898761018999789998598 +3599549898769898993123458987639998789789532123498989898654698999965459975698545789983567899899987679 +4989432999656799654364667996521989598678944234989796789765789798754368964679657899894589989999898791 +9879949897545678967975878989432978436567954349876535699977997679854234943569869998765999879989769890 +9867898765434589878989999578999767323457895456995323798989543569542123899699878909879876768678953989 +8757989987645678989092123489987656212345889679899213997999432198654235678989989212998875654569769979 +7645678998656789299297334569876543101345678998778939876898954569764345989678994323497964323468998767 +1534578999767899198986586679987764512387989876567898765457895678985469994569765434596543212356789156 +0123467899898978987897898899998975643478995965479986543234999789876598989678998645987632103568993245 +4235678979979569876789919968999997856569654987567895432155679896987897878989679876898545314789754766 +5546789765765459984568923459987898768679653498689976621019989954398986567893498989987695424898769889 +7856797654432397213467894698876569878789432398798986543198895432129875456912987698998986546789878996 +9768899843101976434688999987766456989998953789897897654987789843299764347799654567899797656789989645 +9878998754233987549789988996651238898767895678956798969976699754987643235678965678987659878999993234 +7999899965654797679895677965430356789456976799347679998764568967999654016889986789876542989569892129 +6986789876795698989923456894321246794239897893234578976543487898998765127999999899987821093459789098 +5435667987986999999874567896534356789949789921015679895322346789019976238989899999876542912998678997 +4323459899897898998965678997647467997898679933234599797401367898923987349976678989987669899876467896 +3212998789789987987989789398766567896976568899545988689212456897945698967895457978999798767987679965 +4309875646678996556899891249877899954320446798959876578999567976899789879964349865789899654598989334 +3219554234569219434989954398988921967431234567898765467678978965789893989998599974899999543499793212 +4997432123678998999879765987699999876546346788999985336589989994896902498987678989989998932987654329 +9876543245989987889968999876543989987687897899999896213467999876895213567898789299765987821298775678 +8987854556894345678956789998679876999798998999889798101578910987894394678939891019873496532999896799 +7698976677954234599745699998798884899899329998765689313489421598965989899423932198921987649899989890 +6549987988943123689656789899987653668993210987654569986578932349896978989214949997532398999768878921 +7756798999431012698769998789776542557989421297643467899789543456799869878929898889543459987653567992 +8987899998999243459898789698654421345678932398654578979899956789987659767898787678999767998542456789 +9898968997988954568965698598793210156899645469767699467989897899897745656989654589988978987631375699 +8769656986567897679654596439987921367998756899878789359878789998765432345679543598767899997410134789 +9954249987456898989768987521986434456789867987989992198767678999876521349889901987543339876321245679 +9865198765345689199979765430987545768999998946797893987654597898765435478999893976432129865434357889 +9991029984296891019999876542398969899998999235986789976543656799876556569998769896554239876545667998 +8789129876989932998945989653989898989987898949875696989652345789987987678987657789665445987676878957 +8688999999878949877896798799765787679896767898754245799921235689298998789876546678989589998989989545 +7567989987857899765679979987654567589765456789876126999832367893109459899997434568997678999898998734 +5499879765436987654569865598743423469876877896521099898753456954212345999998528678998789987787899949 +6987656976524599543678954329832102378989988965433987659864869896793469998999838989899899876576999898 +9998767897434598956789765497643236899993499977654976540975998789954598987898646898765998765445899656 +8999879976545987997899876987654345678901943988779765321986989697899987876789757999954239654325678945 +7786989997659576889978998998785459789219892399889898732399878545678976745699768998932199867214589656 +6565799989897465679567899999897878994329789902999987543498767435699765434567978987893987654323578997 +5444679878986323493456789988998999789998678893498998684569854324589854315779989876789998875634699398 +6323498759875437894667899976549446699876558789976439795698765416678952104567899865698999987849893249 +3212989643986556789988999895432234579987345679765429898789876527899543212388998764587992198967910123 +5459876532398767993299998794320123992392136789975212969899998678987656623499987653376789349978921235 +6597954321239878932134987689321399889989015699894353459999598789798787536567899762165567999989932446 +7986543210157989321029876578932988779678923456789877678998439896689876547679959854013456789299873457 +9797676521238996432134965489549976567567894578897998989987510975468989658789749862134567892198765678 +4598997432347896543549876379698765456456789679986549999899329876349898778895539879345679943999986899 +3569986543456789656867976568999866331345678989995434987679949983299769899984320987656997899892197975 +2345698754578999767979498689987653210234899998976219876569898654987653969865421498767896798789998944 +1236999885679789998989239795498769329946789877894398765498789769765432358977432389878975434569899432 +0349899976789678999894349892349898998897898966965987654397689879877841237898743467999664313467789901 +1239798999894589998765956901467997987789956645899899765298797989998930356789654569876543201234569892 +2998667899923458929879899892568985465678943234789678953129896595699321268898789678987654562365698789 +9876545798912347912998789789879875323489432123596567891012999434987532379999898799498765684578987678 +9988432977893456894989645678998763218796543034789437789234678929876543456789959989329876795789876567 +9895431866789579999876534569899953105689656546797645678945799101987854579899349878912989897899865456 +8765310145689998999998321345798767214578998687899856789996893212398965699998969769653499998912976367 +7654321234567896789874210127789874323789998788967967892987894323569879789987898758994689579201985458 +8765432365679944598765331235699985434899999899459878921998995437689989891976789347889793459399876769 +9878944456989533459876452346789996546789896912345989439899986568789299932987894236778965998988987878 +0999876567895421246986567487997897657899774101236799598788997679892109893498956124568999876267898989 +1989998698996730178987878998976798768987653212345678987697898793999298789569743013456789994348939996 +9878999789987541359998989659365679899987654323657799986576799892398997678998652124567893986789129895 +8767899893496432499899997643234899999998765434567899975425678901986554599998543236899964799891098796 +7654698921297543987789999832123789998799886865678949876534799999876423678987654545678975678942989689 +9543567890987665996578898753435678987689997976789421987646789987654213589998778659899986789659876548 +8912478999998789875466789766576789986579999987896610198757891098785344567999899789967997898998998957 +7894567898999896984345678987687898765459892199965423459868989129887895678999929892158998987897899868 +6789789987899934986456789298998949654328789013986594569879578934999976899889012999349989675876789979 +4899998756789915698567899129989939869212578923987989978989459899653987897678929998959876543365679989 +5999897647897896987678988999867899998923459994699677899392398798942398928568998997899985432124567890 +6898765530146789999789567989654678987995767989987566789210987687890999312456987976899899321013479931 +7919654321237898989892379878943569895789999878976455899391296566799889202369876345697778934154567899 +8929865445356987579954998769892398784679889767895324988989987434789768943459965237986567953245679978 +9934986656767893467899877555679989613498767856991015976568986523598546899698954356975468967456789767 +9899997768978922279923965434568976501987845345689129896459876434987656998987895479864357978697997656 +8767898989989210189109874323457898319876431234568999765345987845699767897796989599865267899789996545 +7656899591095332398998765446568987634986545489679988653236798956789878986675978987654356789899989326 +8767999432986745567899976757678976545697657567989876542124569979892989965434567898865468993999878939 +9898998993987857898967987878789989656789967979399986321013456989901399876512367899979878921298769998 +2999987789998969999458998989896799778999878989298765442134567895313567985403456897989989942987657897 +1298986678999878998569769997955459889901989892129876653485698989494579875314567896998796899996545956 +0987854567999999987678956976545368999892398763012989764578789876989989994323698965789545678989434345 +9876783456889323498789543989631259999789987653135699876689992345678999985554789654678924579879921267 +9965432345679212589896532398920345987678998774256789987799101256799339876765896532467896798768895348 +9876543456798954679987421987934599793589998765345678998898942349989212989876897651278999986545789458 +3998654567897799798899910986899987654678939978458799769987895498968999995989965432345698765435679567 +2198777679976687987678891965678999769899212989569897654216789987654678954399877643567899654323569678 +1019888789465456986546779878999239878989103498678998765345678999543789967894998654689998795434578989 +2123999994312349876534567989654347989378915679789329876557789987654567898923498765891019986795989295 +3235986543201456987677678999987656896567923899893212998768994399765678999434569978943523987886892123 |