From a75a973c2e05dc1168da2aebbbd29de2d17e5eca Mon Sep 17 00:00:00 2001 From: Alessandro Varesi Date: Thu, 19 Dec 2024 13:13:58 +0000 Subject: [PATCH] day09 to day19 --- solutions/alv67/day09/day09.ipynb | 222 ++ solutions/alv67/day09/input.txt | 1 + solutions/alv67/day10/day10.ipynb | 97 + solutions/alv67/day10/input.txt | 45 + solutions/alv67/day11/day11.ipynb | 94 + solutions/alv67/day11/input.txt | 1 + solutions/alv67/day12/day12.ipynb | 178 ++ solutions/alv67/day12/input.txt | 140 ++ solutions/alv67/day13/day13.ipynb | 141 ++ solutions/alv67/day13/input.txt | 1279 ++++++++++ solutions/alv67/day13/test.txt | 15 + solutions/alv67/day14/day14.ipynb | 193 ++ solutions/alv67/day14/day14.py | 185 ++ solutions/alv67/day14/input.txt | 500 ++++ solutions/alv67/day14/test.txt | 12 + solutions/alv67/day15/day15.ipynb | 340 +++ solutions/alv67/day15/input.txt | 71 + solutions/alv67/day15/test.txt | 21 + solutions/alv67/day15/test2_mini.txt | 9 + solutions/alv67/day15/test_mini.txt | 10 + solutions/alv67/day16/day16.ipynb | 463 ++++ solutions/alv67/day16/input.txt | 141 ++ solutions/alv67/day16/test1.txt | 15 + solutions/alv67/day16/test2.txt | 17 + solutions/alv67/day17/day17.ipynb | 265 ++ solutions/alv67/day17/input.txt | 5 + solutions/alv67/day17/test.txt | 5 + solutions/alv67/day17/test2.txt | 5 + solutions/alv67/day18/day18.ipynb | 166 ++ solutions/alv67/day18/input.txt | 3450 ++++++++++++++++++++++++++ solutions/alv67/day18/test.txt | 25 + solutions/alv67/day19/day19.ipynb | 121 + solutions/alv67/day19/input.txt | 402 +++ solutions/alv67/day19/test.txt | 10 + 34 files changed, 8644 insertions(+) create mode 100644 solutions/alv67/day09/day09.ipynb create mode 100644 solutions/alv67/day09/input.txt create mode 100644 solutions/alv67/day10/day10.ipynb create mode 100644 solutions/alv67/day10/input.txt create mode 100644 solutions/alv67/day11/day11.ipynb create mode 100644 solutions/alv67/day11/input.txt create mode 100644 solutions/alv67/day12/day12.ipynb create mode 100644 solutions/alv67/day12/input.txt create mode 100644 solutions/alv67/day13/day13.ipynb create mode 100644 solutions/alv67/day13/input.txt create mode 100644 solutions/alv67/day13/test.txt create mode 100644 solutions/alv67/day14/day14.ipynb create mode 100644 solutions/alv67/day14/day14.py create mode 100644 solutions/alv67/day14/input.txt create mode 100644 solutions/alv67/day14/test.txt create mode 100644 solutions/alv67/day15/day15.ipynb create mode 100644 solutions/alv67/day15/input.txt create mode 100644 solutions/alv67/day15/test.txt create mode 100644 solutions/alv67/day15/test2_mini.txt create mode 100644 solutions/alv67/day15/test_mini.txt create mode 100644 solutions/alv67/day16/day16.ipynb create mode 100644 solutions/alv67/day16/input.txt create mode 100644 solutions/alv67/day16/test1.txt create mode 100644 solutions/alv67/day16/test2.txt create mode 100644 solutions/alv67/day17/day17.ipynb create mode 100644 solutions/alv67/day17/input.txt create mode 100644 solutions/alv67/day17/test.txt create mode 100644 solutions/alv67/day17/test2.txt create mode 100644 solutions/alv67/day18/day18.ipynb create mode 100644 solutions/alv67/day18/input.txt create mode 100644 solutions/alv67/day18/test.txt create mode 100644 solutions/alv67/day19/day19.ipynb create mode 100644 solutions/alv67/day19/input.txt create mode 100644 solutions/alv67/day19/test.txt diff --git a/solutions/alv67/day09/day09.ipynb b/solutions/alv67/day09/day09.ipynb new file mode 100644 index 0000000..fddd45f --- /dev/null +++ b/solutions/alv67/day09/day09.ipynb @@ -0,0 +1,222 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# -- DAY 9 --\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'size': 94798, 'free': 44967, 'used': 49831}\n", + "The solution of Puzzle 1 is: 6288599492129\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "#from itertools import combinations\n", + "from icecream import ic\n", + "\n", + "test = \"2333133121414131402\"\n", + "\n", + "retvalue = 0\n", + "\n", + "class Disk:\n", + " def __init__(self, diskmap = None):\n", + " self.clusters = {}\n", + " if diskmap: self.import_diskmap(diskmap)\n", + " \n", + " def size(self):\n", + " return len(self.clusters)\n", + " \n", + " def info(self):\n", + " info = {}\n", + " info[\"size\"] = self.size()\n", + " info[\"free\"] = len([k for k,v in self.clusters.items() if v == None])\n", + " info[\"used\"] = self.size() - info[\"free\"]\n", + " return info\n", + "\n", + " def import_diskmap(self, diskmap):\n", + " \"\"\"\n", + " Import a disk map\n", + " The disk map uses a dense format to represent the layout of files and free space on the disk.\n", + " The digits alternate between indicating the length of a file and the length of free space.\n", + " \"\"\"\n", + " dm = map(int,list(diskmap))\n", + " cl = 0\n", + " id = 0\n", + " is_file = True\n", + " for c in dm:\n", + " for i in range(c):\n", + " if is_file: self.clusters[cl] = id\n", + " else: self.clusters[cl] = None\n", + " cl += 1\n", + " is_file = not is_file\n", + " id = id + 1 if is_file else id\n", + " \n", + " def defrag(self):\n", + " free = [k for k,v in self.clusters.items() if v == None]\n", + " used = list(reversed([(k, v) for k,v in self.clusters.items() if v != None])) \n", + " while used[0][0] > free[0]: # if used to move is in a cluster following the first free cluster\n", + " from_cluster = used.pop(0)\n", + " to_cluster = free.pop(0)\n", + " self.clusters[to_cluster] = from_cluster[1]\n", + " self.clusters[from_cluster[0]] = None\n", + " return\n", + "\n", + " def checksum(self):\n", + " return sum([k * v for k,v in self.clusters.items() if v != None],0)\n", + "\n", + "\n", + "with open(\"input.txt\",\"r\") as file:\n", + " #file = test.splitlines() # decomment to use test \n", + " diskmap = [l for l in file][0].strip()\n", + "\n", + " disk = Disk(diskmap)\n", + "\n", + " print(disk.info())\n", + " disk.defrag()\n", + "\n", + " #m = \"\".join([str(c) if c!=None else '.' for c in disk.clusters.values()])\n", + " # print (m)\n", + "\n", + " retvalue = disk.checksum()\n", + "\n", + "print (f\"The solution of Puzzle 1 is: {retvalue}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'size': 94798, 'free': 44967, 'used': 49831}\n", + "The solution of Puzzle 2 is: 6321896265143\n" + ] + } + ], + "source": [ + "# --- Part Two ---\n", + "\n", + "# This solution uses objects defined in part 1\n", + "\n", + "test = \"2333133121414131402\"\n", + "\n", + "retvalue = 0\n", + "\n", + "# --- class patch ---\n", + "# Modify the original Disk class\n", + "# `defrag` method now accepts the \"method\" parameter which can be either \"compact\" or \"files\"\n", + "# If method is \"compact\", the method will compact the disk using original `defrag` method\n", + "# If method is \"files\", the method will compact the disk mantaining the file unfragmented\n", + "_defrag_compact = Disk.defrag\n", + "\n", + "def _defrag_files(self):\n", + " # map files and free clusters in clusters\n", + " files = {} # {id: [start, len]}\n", + " frees = {} # {id: [start, len]}\n", + " last = -1\n", + " id_free = -1\n", + " for k,v in self.clusters.items():\n", + " if v == None:\n", + " if last != None:\n", + " id_free = k\n", + " frees.setdefault(id_free, [id_free, 0])[1] += 1\n", + " else:\n", + " files.setdefault(v, [k, 0])[1] += 1\n", + " last = v\n", + "\n", + " # DEBUG print(\"\".join([str(c) if c!=None else '.' for c in self.clusters.values()]))\n", + "\n", + " for file_id, (file_cluster, file_size) in reversed(list(files.items())):\n", + " for free_id, (free_cluster, free_size) in frees.items():\n", + " if free_size >= file_size and file_cluster > free_cluster:\n", + " self._move_file(file_cluster, free_cluster, file_size)\n", + "\n", + " frees[free_id][0] += file_size\n", + " frees[free_id][1] -= file_size\n", + " # DEBUG print(\"\".join([str(c) if c!=None else '.' for c in self.clusters.values()]))\n", + " break\n", + " \n", + "\n", + "def _move_file(self, from_cluster, to_cluster, size):\n", + " # check if to_cluster is free until size is reached\n", + " for i in range(size):\n", + " if self.clusters[to_cluster + i] != None:\n", + " raise ValueError(f\"Cluster {to_cluster + i} is not free\")\n", + " # move file\n", + " for i in range(size):\n", + " self.clusters[to_cluster + i] = self.clusters[from_cluster + i]\n", + " self.clusters[from_cluster + i] = None\n", + "\n", + "def new_defrag(self, method = \"compact\"):\n", + " if method == \"compact\":\n", + " _defrag_compact(self)\n", + " elif method == \"files\":\n", + " _defrag_files(self)\n", + " else:\n", + " raise ValueError(f\"Invalid method: {method}\")\n", + "\n", + "Disk.defrag = new_defrag\n", + "Disk._move_file = _move_file\n", + "\n", + "# --- end of class patch ---\n", + "\n", + "with open(\"input.txt\",\"r\") as file:\n", + " # file = test.splitlines() # decomment to use test \n", + " diskmap = [l for l in file][0].strip()\n", + "\n", + " disk = Disk(diskmap)\n", + "\n", + " print(disk.info())\n", + " disk.defrag(\"files\")\n", + "\n", + " retvalue = disk.checksum()\n", + "print (f\"The solution of Puzzle 2 is: {retvalue}\")\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day09/input.txt b/solutions/alv67/day09/input.txt new file mode 100644 index 0000000..ad06504 --- /dev/null +++ b/solutions/alv67/day09/input.txt @@ -0,0 +1 @@ +6337613674436833695582382518294574934721895775456926659050519789764499137091974516817593123529825470413735998773313821249746165140476827548333979879759812148140743921984858367387865689863575979767978384602135617653231357745451442716162787988827217792125086367824652239497919721686553336289590824034825884491882728622562067753798821229222238807634124749916752577072651378955553992845307918307276391238273773149858396433832536796653365434709657851887396187578778147166906832666361736921666530215593938020386798211757213535118020656880772626853567534823537521847840542462424239748076442664335159933397986757683414553370933017533841909225785682535581657913534751914590354573479543352482677664279490115563578845916997385280799060446627827972734570759842272566609483169585119611369745574079877574611920292074449221344989775049422092807055209772581092501625426515216037533372713253769756161167528724961425674338433856921993913658367042577497436930301681312780243028924226184437743980832960764956152123711024813868188023445957797073319557834842443457408060431584672765711965523592339064155945688420399677786021375036865224718236192794168244218132331879653238514185879711274422704721314129454939677194798258512282384257688549556871296166858544234847196990249480549228468620477732643536689838393877978653367792853453997762592631241338636138577555428914232648823466514071894652137678142034849239193626153640623580414314608933385485612012888459733812386760439427452815938894615323396842132211755866147610694370823973397748963732281746466628818129365432979699941761269528742324281144556379381879602911724569887421245076318843809377436853841020844590787517655729552955292366331147517060174571596182569363324916905792827650803161491453136021278077732064374448109498165846527088615498892332771430958179814356621939482129587840825717107138658080991769344985444860919820564023672497821693314755599976209047988027535412418173944146379780263754526214261017834795745288115763115420595437959121698079541886909440959071743761324933549055785895219883434371956470166162332913626974228698704867909040649016617460867032767038334727116689244913263370265020373034542849904912599647836283459162238825918961705866907222166252213569835943736588468231414457382040649035476988352594163315317533816572151422835818584798813953851735242330898787799654338389819473342688805893283467278648262129884651697935311570182570622882847035353690402079255041929980106820933987229229797544269317587273137530758375497634699083283818553718955173431710764611483099989260285267944525422740201440336499923419596970234642786695265316332262177054801980634357789526362333385795223688334671859856597460299593595342948524369087665258874015146296241079817536554214141611547952197222448591679959466790128097793753463968675487268040477815563380229164213672752215208397193598924987982747832046393487916058272183247276523097304784635757381389468220157974675179325452839698486360399879695439645913991513175369124373993030541020107278592224606843141533658010212677209043325490342134728924457069965191109858378318612965799852635497747794734595236056575848591924766220818282475324396727508923606980769458725299525452612238764560262657775582924569776483862349887068324449156297506644312010698479354773245797667563279586421294657685887842714452735721406358806171998745643329816772286796704744766044588635885245655459774311291948625491629489845688426449351717832871305285577753164547112747414863694575184763986239102380914887326641428026877699225992392096482370418830381415159027914953351339474421536726145911393866697198669419803537365630324763404171851150754014952414412764421984874654951033761733339938562539501446678133468715754993394758543046223523398728955356737781406931429746223633763241354625939226463718409470443784758784373146313839928768614814211356253038934558927790904988453344509018747586929116183883508082777047599959667039225085656443324675746726742070671570757088224324721174549372663665357073604929544480355015119614695352475587896476298629578751175152953418694340237315682094281425544939961496671928705760203087589687943595183450878840612944545990131498239234836114902680973922971833131647941447156647709468389679862137111593607085798425435736388659127388489737118418537272479942534595188821602597196231331570739573219060339186363023917360728735156330123729551057656522303564363389388580584548939620728350317592847949877699604391352991731027339689607733987355581433793686246693841298838454573798145112168184911056903380103939467378844737779330194582116721272190126779182733559651836358413812266428668253391218604697749045971951622863863588909757411613156843452329293637464367447412392465939681589644859070551682234527516285233194458768183747577595703213148321859615511124931012101096951580915748936348216536567577647345618573868040994546908948496431144262585963718473204983249712109511962363539684909657287652765145553168177329822059904713775018257475153084721036958345931122317816828966716917929036331813946978532772968156626894887060457595911112698920659795712217521356813441884054927773105910344095843587332240363175408543339394339754807633749459838320794731205385952599245779545463637677622645108195612623887347136947349218615058814317681562727714898317596243793965116687212563705877786822815789988123603591795023738693382690454046657084473211597057565085917118789367276980521612494578194026531818987249469124386126122415682222322785478858162341196220598720942538174678669338334144411616218114529645729015571427943766119559722940611071781160982038591481957046582317982151268348438015462649566987761124997382477030901073172225468482251539521143355049168777186559465814126385549289545344211835245982625125786381338257971221445373701191776744297550207532252995708718432544403650529488878874915913464990486587812957269030956637239120381022832692817689602043696287676467587570878486525718823165551261687518429754774245315021651338636764484350135479213885806161335348965969341227654448746939327684624236497026379584105050205255634761994094712532525831389115348186169141389680105482721327111978828124201413861594194697502734882034525432825418442610867277989795284532759535851897967018381472455583585410245320724330341842215866176435108088971522567851816733796678508940456225975855585595277273901463644912505629167381536580979132851564535012182248751454298695635824599891513318666197919558176659169035492732468980354575433031869119545115828617126235483145101030888380755097641721269289819252915163681991273117625742455972777078403787919098335028881553164381402373528850236676856276368544475592847693925018622038791887713823931196635352538247537890131246267683973715863190456868257948359760239323977384213694549358956978181182122967304849857372228325903747426476608898746240744817528036709779193739134219216866438114155645473311739596827667981895748844631593378517235020548651227711846982944597869998243436401557666566657193462937963370396664454351507496647677638497574720964147763510732130582157682611377855878086884573952288111156826393153783361413483732305029526184236493596364649031431266906091985367859675794860665178697287144866428987268559988039191968119095678849374593968273575451255419103217488360539711467757717580153934185940902386869733625034849733547643415420935384417326834566992817788730185960489284486123337770797889191488949918849226293219662965416347609198347271562582141133431949132947382976707770399424395882799585658930162046718434789811378453987595923414319998585639683457286939181428618458347847486882164052411527916472637695671224483473716461233435863763711344822992667886347465488896271595626358532841441633152340398424761734233818111110858785217062138357753145579312765336127051363683573810761450956844559842513012821837136638973241355436731548455141971210826194257612574729864947292724111968681020596834863526682087338718145249923845165870111354322898884163568478729733585223367351821965883252451753693266674873925595669393724433606724281058362066318652804579137536739840417092106798864036418288231415299596263224115915584359535363584034506875284620262177853276163013227772405175145790268766594532179992229592303412381360199497454013379034341063834776332825217625176964951153937624591887939449425268626087929653413722467448223844937751916633633484409696854596551729433642289287197655923447462790942511183336537862507844918883702128848757287234578849315457618655928136531897543765628074292820357089869071945710464344801322322145521461178550737380896899257293861837154826273932708443811913764579769741359899682767383469195864634770703014789354854098417991136894641694777643397997359142706661839490373691904560935618171897326620259887471828409975399571576083481536903367501241515528883781906054118560395428716788723931703262901793569336294744851875553139448022533427944235469819745383349574183066986316865636805088893985261041985053345378992094717326683721483153937887929651885142178337259114828952834252192526293095647420459979841087233427796382451528204485179099629193954559814479136546673018753986662341603947209388277639234414572138659757368877268628795636262364294667444853726635558723856367489160174573935834549632723214892177543464621283139484736810738311442830188647619225596633461489618951503638688264546045187444248066113461444493965294685483175867804841469824291524212522298152763473316617516659444072344513906024841758129293367796756299992817952864557389664112425985587867889440575050923146745022851752934443214226746444491030724758803654132877369066501073132234571159198750958157996817708380218437385326391331119264955231877250983555485883635645463573961942109160465857943718628436376535105898441874215341715431665461692183411616449269381844785265944893526124583381744667142482772490531980679397273759499939456913644549395883732852537782101311968897155874861342842018147227494457159627499289175578532126188462306123579879277913909392621824195157777142805116294630261554828662195623307617656591729639371423713715336614611955775689468869922190555544774621338396548541325735985782345776144542314284258263835340553010213168536927827496133591523962928825833771518548846511346629356370435736949475557929144688547276944063809397541573304561875822973025675026367855962548864962855642778050219848663652665574233936153658388645541458339324232920568132688519604359659850869785864825469885387144771490478169459413853676179396585580472064683516935849926945496039486078328315539584586039246265257248828147657732138115734790255643239515164758597091536739436438174164113074644536611575276935845527534213382284304563725143755817432440314999268815213395114384453232553465692847193634393013679513897456164111889939794184188141436331354328396836544865704783978264183535329166515429525129598097853362226962927939581625599949246475563978803159862680778374285462609622536697559586661796691151454912296642246267296765833955452084156183783043116895837368128916996510453958514413331283915322969253508747389213218159471852483743256298319355781759964635432359137476195537317985924634287633431212524386189794751287351412806810278410346474296212346744939610159596659270659629673495348989458581724790322398942662225349774396405075945072197584739798309557867811647070319268631630398581668267651392524590633096494912264612924449816790337979964164402960605873875457469068529260961059784414321053237693989086464289825068328899955121722245363846648563691317832155223312542780826480348962672587213999234324364054664334708060577380321784331456425991619465154450333671142450144447442396339835333249815110428360224027905830278221169011563357154691382123482635611264887226375396795739836992468030324641774090451633853728419289616768234214817648481995227278488445583830778222767438671169242578832872853031567083717644902723543694819848316277133997524664641613546864927449882293917033785093806843625918842457445085575245571516392988637380591825807431636917624477277715452550807243281482309613344783546138515999585641692247452544545413107992709462826570686427811842355299495281728025718568288915863793551276113467591760756630979639749910256298156478834124471176763484833710241835354210918124495038679970721693505780949985767125832694782250425257729338365068299092527235297285645510647822793852106873847288904015247791525388768473243468214049994496971142777031421486751341467842755051853654815893606341799349986870525437159820746793555924269936446251858999677861821154694452729052419564214081357714167996157955619594426662523046323745986792952518586130818455723839807218618068805457205695212324365163584264429693831524576397795761348547686929433235979064348939808494908330198788477667228815481355251234257844327340846447137671556733816957474456747191525366415057659329726345766483706182639818753959764537599346133036217337439991634820591894955470723659955577359438345457764985119651584473863613386761323292143747219571691087232492558583429698285437166077578358181098547781171625247779598649338025806215507388456775185219125264557060885738197958928741344489803443446495754221179649375370676673396993904787705062211843112579423458644517855183792679754773188274846679239925763130596983283382965648227614836810785940167059139491261416696468638832315762941596544025857057751715371967777666697772876069336199463617142487541880776952449576389311822646242249947597228495598982182954246841652150543585617047735047859017453426967132353114972596424930545877895198215355163349374336681238383022205930473871721771586666875956373413683124698216137326675314842622451420667265609441154445551227429739106722272729839260602435417652258542333979468146896131348395775437583318136355103959745717155598659947672784937371869230948754363217297921588179378144723266661367497544859059269446827813394770173637398797758319609053405667904492985158187691834423762137202861472654296077152388819043151140946389221823125443899451632222476790789873223711266592595925116994992181299388617496138928429839494731505118244154301655474516344088452635655683984510667315887854122452162942955873797777853267995251822395917241608713975029609625643659989233875231978831171127936175861739515022822317554545212286515644167228684047875427391195991863989637618057542017452115253618938983524673746829185999733222561834121269155794864250488753262380507553706478562973819619542141342735955011713556165384117958943883737723365875446597709111347296937856866467905393522842767149469647365537691944373855114664419916882219223063672867692729361333474391955039724971784375125416996233395017764396602846192536655567296779679278609667154680849436614859544743239094791873524992316125354960517335378182221259889813834346567755771323128723163562546248535623263885908494319897297623864453728231218611135812217219428693651889131827663422326637723769196430699925218971173046113841251871378073659943787055237198593965346248442898316762659036438489648139103753162011496859433741933868224238204510322214452844221637722382427015106498786717763270332864105031649290433912642587767422983791413925444769233521642151658238624630809141825293276233865192161625775296952159783745415786602975782469405610425528986838547828891637406853725461523355915869963049357358823098225914199918967476152558572789456944936131397230237652699717175454354711538513622657401094458498438184667630222849328989437359973112147332344499845665584683806312798378586029769122278248636828284033637377848786275417141298611934687238122897815066484959788480333523322883418519715986563920939934281371987862847138201224455041907973825632829167819045993950829183666334896560813352931441335357684212522834547453371574848462806622191687756144949952408136521683898868388452519021399519665570762091839436945990899972972148582244857388924441925373296357101246122953383073441519724652645575709163495512662760343981806322803874882725847756881855865238569663226017223676131752897078324711431631871990632434197464323470367238718584738622652537409166342374151915483378909128242574414358878470407154909276182738695015442123261355554321156972878521337044223750202719989964938033615697423335925672947424681536685479968933294817779780789675464273632135735012813211629673407533781951483375615836706313706650196731734958247883439196794598438159295186451414285525422994631979771273581899756071147412218836401829981023983745346892291673705329765033621780815185973139539589121521667773876910345295532271318692848888358317583558997924398679177096785767627111899023816875736047724954798476955821847191297324997773972033836974844541446558613851596277871376428129965546954196512158479293738766318748759425401859683065962720338343843850106230129026108480647262683558912182558351536419495615732835822832729325129880788671202197689547752610185243994394877989122313122586353978595125104366912870849191596129131085802237456485787924888865452424685897488414381725596847747525816980938046614244627085771718233851128090959631212691447921723729266743853222495442728777868128401771858542753643654225513679635775612890651120459684872791521699999116696747302375702033701897584729423039726380701138235332624087451426481169324119227684713912524634979751626757419432979648373017882233127210346867163595106688773580215220226998815663696384685838227053954422903994204566737391989086972060982087625682695330609494368055108425781978987174522541118642415352453445584372273735596755213513939420601883345189576993658955634545542453424668855468431029251114102433834650679475263061906063628919603016802457692193856970236452734138158219472180916523374618199694273432781933811623491870462674627686625861797180793040966797871419662333136132241219454470498469901766374294579223188146573218945067439579265070634310252231449260938311251163998142564955468399264759376019669174645477912820773295254439118121357424578980884970342120338282934361577575432850614479253020362739962226209031951973699646439216383889838422994954408425802173412458918591247133378257967740893380116454777188518030201315959125497527107749511578621783655524164863483662273121338812269777748774276410275444444872337952205433241328569489573571999919219483737916998979932178498553924018925910671910453675111833722469102338968819854251223174234116697485784715361432682528473230489471583365853154491527326515888549198017861169467128552365544324985981132973288919312491726030508189824897987657426973452330713247449656226956267055243232234054176374528060523191567247573862696241274644733416634856331697344323142052183919277466295251929396846449317439528524895431839721121845206612857284293627459228602481924220924633111543171522875687462699446793283212996431615473103881336877124839747758563939682613137695479923869353851263593577377518781176893293343895977736767959843795645594642787706715481454822583864480373263263655353332319183921654598561107150513511359957373783413712989182548330833667444193328628688017614811681518475230874794428333773158735865272012958824108338307358599510409340253390391937249035815879871465397037972062667085261427928229566536525526562819439859509550374017691899839510832333987379741151942812691097379963162377306323705772113411819212865272265597763953625473816144262991343277713137979171743257137386722257967182735541812071385937499178251166965928479853717072775667379096172346542611733271608099535328967234138674786176796050821138202654951131149161875337295721184775515730939431488326964582846878274856207733565520335339151128942475295377621646169097337365271529103680412255102571879043482973102328398772181627881663464280232788351999483253491733557133125585922920264456336159659833274731229845385830985385441936402721523743142922623492524233456696586317552748266373427486778672212880477313609843844859766273476888335038548955695172694917705027964833842887853672119291775574761329344194439988766815406978285370152350874549112099737774687854288610685169134265535344567024465441347023993843229312235886194243838613182550513624324938319347673780711773654210252746668131823063167067636152381295651988393415368846478570647270233618121683781210618559195513772247797933741634686136547591668021271819254224567251104656963126879318261413799592106347755896572668777175578384546521815418765834506675783020703635994388936383353960711622546164293 diff --git a/solutions/alv67/day10/day10.ipynb b/solutions/alv67/day10/day10.ipynb new file mode 100644 index 0000000..4bb4b18 --- /dev/null +++ b/solutions/alv67/day10/day10.ipynb @@ -0,0 +1,97 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# -- DAY 10 --\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of Puzzle 1 is: 574\n", + "The solution of Puzzle 2 is: 1238\n" + ] + } + ], + "source": [ + "# --- Part One & Two ---\n", + "\n", + "from icecream import ic\n", + "\n", + "test = \"\"\"89010123\n", + "78121874\n", + "87430965\n", + "96549874\n", + "45678903\n", + "32019012\n", + "01329801\n", + "10456732\"\"\"\n", + "\n", + "ret1 = 0\n", + "ret2 = 0\n", + "\n", + "def get_trail(grid, x, y, sv) -> list:\n", + " ret = list()\n", + " w = len(grid[0])\n", + " h = len(grid)\n", + " if x<0 or x>=w: return ret\n", + " if y<0 or y>=h: return ret\n", + " v = grid[y][x]\n", + " if v != sv: return ret\n", + " if v == 9:\n", + " ret.append((x,y))\n", + " return ret\n", + " ret.extend(get_trail(grid, x+1, y, v+1))\n", + " ret.extend(get_trail(grid, x-1, y, v+1))\n", + " ret.extend(get_trail(grid, x, y+1, v+1))\n", + " ret.extend(get_trail(grid, x, y-1, v+1))\n", + " return ret\n", + " \n", + "\n", + "with open(\"input.txt\",\"r\") as file:\n", + " # file = test.splitlines() # decomment to use test\n", + " grid = [list(map(int,list(c))) for c in [l.strip() for l in file]]\n", + " \n", + " for y, row in enumerate(grid):\n", + " for x, v in enumerate(row):\n", + " if v == 0:\n", + " trail = get_trail(grid,x,y,v)\n", + " # ic(trail)\n", + " ret1 += len(set(trail))\n", + " ret2 += len(trail)\n", + "\n", + "print (f\"The solution of Puzzle 1 is: {ret1}\")\n", + "print (f\"The solution of Puzzle 2 is: {ret2}\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day10/input.txt b/solutions/alv67/day10/input.txt new file mode 100644 index 0000000..d3da5e8 --- /dev/null +++ b/solutions/alv67/day10/input.txt @@ -0,0 +1,45 @@ +676781023010121078756541010565410126589652103 +787692014523134569687238921076321087676543012 +896543210674013278798107831089980896567122107 +654100134985329143237356540123678925498033498 +783210325676438050123445443294541012321044589 +694309018984567267034576356789032008769655678 +345678567823432178125689219878102109678724369 +456969430214563089068701008765210234569013212 +327854321005478873879010123674377654354321001 +218901232876569912968123294589988912210132432 +107650343985567803451054387487676903432101561 +210545674783498712589965236596567876543650170 +323432185692105605678876145645430967858743289 +214981092185434104987986001034321458969801001 +105670123076393213098887632125010321578932102 +789889874101284332106798540136521230432840013 +876776965692379876087034567287650145521051224 +965460150789561045696129898398010676670569345 +234321041276432038765408765498723487989678496 +165432132345987129932317454389654395432310987 +074540122187656087801326761230101276211001236 +783458043090345196540410890121210989303456545 +892169834901210105432589789032367893456327896 +701078985810012234501678776543456302587410187 +667654856798943107657578905494543211693217896 +578983012367874038748765412387687600784506787 +457832343455465129889854307898990521099615690 +300761567854321012934781212387121434988794321 +211650434969482103245690101236012345670188760 +672349123478091014132386789845621012873279454 +589678012562182365001675632736790123964560303 +432547001601276478976543541345887654456781212 +321232118762345569885012310212994569323998800 +210321129098710378894322343200123478010878901 +300410030123601256765011056123430765430765432 +321567542034510349810782987001521894321045645 +434788601945654878725693965432676541013236012 +095699717898783965434344876501987034901107823 +187659826500192854303239884567698127872787934 +234549834410201601214138793298012016543396543 +067812765325360519871025682105623456671230123 +154908901876451456789014871234702965580145674 +233217010945962359874323960189811874495432985 +945606321034876543265221054076320432356781876 +876545432321089012100100123165410321065690165 diff --git a/solutions/alv67/day11/day11.ipynb b/solutions/alv67/day11/day11.ipynb new file mode 100644 index 0000000..c0bfc45 --- /dev/null +++ b/solutions/alv67/day11/day11.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# -- DAY 11 --\n" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for 25 blinks is: 204022\n", + "The solution of for 75 blinks is: 241651071960597\n" + ] + } + ], + "source": [ + "# --- Part One and Part Two ---\n", + "\n", + "from icecream import ic\n", + "\n", + "test = \"125 17\"\n", + "\n", + "blinked = {}\n", + "\n", + "def stones_blinking(srones: list, count: int) -> int:\n", + " return sum([blink(n, count) for n in stones])\n", + "\n", + "\n", + "def blink(stone: int, count: int) -> int:\n", + " retvalue = 0\n", + " cifre = len(str(stone))\n", + " ret = blinked.get((stone, count))\n", + " if ret: \n", + " return ret\n", + " if count == 1:\n", + " retvalue = 2 if cifre % 2 == 0 else 1\n", + " elif stone == 0: # 0 -> 1 \n", + " retvalue += blink(1, count - 1)\n", + " elif cifre % 2 == 0: # even -> split\n", + " retvalue += blink(int(str(stone)[:cifre//2]), count - 1) + blink(int(str(stone)[cifre//2:]), count - 1)\n", + " else: # -> stone * 2024 \n", + " retvalue += blink(stone * 2024,count -1)\n", + " blinked[(stone, count)] = retvalue\n", + " return retvalue\n", + "\n", + "\n", + "with open(\"input.txt\",\"r\") as file:\n", + " # file = test.splitlines() # decomment to use test\n", + " stones = list(map(int,[line.strip() for line in file][0].split(\" \")))\n", + "\n", + " BLINKS_PART1 = 25\n", + " BLINKS_PART2 = 75\n", + "\n", + " ret1 = stones_blinking(stones, BLINKS_PART1)\n", + " ret2 = stones_blinking(stones, BLINKS_PART2)\n", + " \n", + " # print (blinked)\n", + "\n", + "print (f\"The solution of for {BLINKS_PART1} blinks is: {ret1}\")\n", + "print (f\"The solution of for {BLINKS_PART2} blinks is: {ret2}\")\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day11/input.txt b/solutions/alv67/day11/input.txt new file mode 100644 index 0000000..a8f124d --- /dev/null +++ b/solutions/alv67/day11/input.txt @@ -0,0 +1 @@ +0 37551 469 63 1 791606 2065 9983586 diff --git a/solutions/alv67/day12/day12.ipynb b/solutions/alv67/day12/day12.ipynb new file mode 100644 index 0000000..ba93c38 --- /dev/null +++ b/solutions/alv67/day12/day12.ipynb @@ -0,0 +1,178 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# -- DAY 12 --\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 1 is: 1370258\n", + "The solution of for part 2 is: 805814\n" + ] + } + ], + "source": [ + "# --- Part One and Part Two ---\n", + "\n", + "from icecream import ic\n", + "\n", + "test = \"\"\"RRRRIICCFF\n", + "RRRRIICCCF\n", + "VVRRRCCFFF\n", + "VVRCCCJFFF\n", + "VVVVCJJCFE\n", + "VVIVCCJJEE\n", + "VVIIICJJEE\n", + "MIIIIIJJEE\n", + "MIIISIJEEE\n", + "MMMISSJEEE\n", + "\"\"\"\n", + "\n", + "test = \"\"\"AAAAAA\n", + "AAABBA\n", + "AAABBA\n", + "ABBAAA\n", + "ABBAAA\n", + "AAAAAA\n", + "\"\"\"\n", + "\n", + "def fence_sides(fence_map: set) -> int:\n", + " retvalue = 0\n", + " fences = sorted(list(fence_map))\n", + " last_d = None\n", + " last_a = None\n", + " last_b = None\n", + " for d, a, b in fences:\n", + " if d == last_d and a == last_a:\n", + " if b != last_b + 1:\n", + " retvalue += 1\n", + " else:\n", + " retvalue += 1\n", + " last_d = d\n", + " last_a = a\n", + " last_b = b\n", + " return retvalue\n", + "\n", + "def find_region(grid:list, x, y, mapped: dict):\n", + " fence = 0\n", + " area = 0\n", + " fence_map = set() # (\"hu\"|\"hd\"|\"vl\"|\"vr\", a, b)\n", + " w = len(grid[0])\n", + " h = len(grid)\n", + " plant = grid[y][x]\n", + " to_check = [(x, y)] # list of coordinates to check\n", + "\n", + " while to_check:\n", + " x, y = to_check.pop()\n", + " if grid[y][x] != plant: continue\n", + " if (x, y) in mapped: continue\n", + " mapped[(x, y)] = plant\n", + " area += 1\n", + " if x == 0:\n", + " fence += 1 # border fence\n", + " fence_map.add((\"vl\", x, y))\n", + " else: # check left\n", + " if grid[y][x-1] != plant:\n", + " fence += 1\n", + " fence_map.add((\"vl\", x, y))\n", + " elif (x-1, y) not in to_check:\n", + " to_check.append((x-1, y))\n", + "\n", + " if x == w-1:\n", + " fence += 1 # border fence\n", + " fence_map.add((\"vr\", x+1, y))\n", + " else: # check right\n", + " if grid[y][x+1] != plant:\n", + " fence += 1\n", + " fence_map.add((\"vr\", x+1, y))\n", + " elif (x+1, y) not in to_check:\n", + " to_check.append((x+1, y))\n", + "\n", + " if y == 0:\n", + " fence += 1 # border fence\n", + " fence_map.add((\"hu\", y, x))\n", + " else: # check up\n", + " if grid[y-1][x] != plant:\n", + " fence += 1\n", + " fence_map.add((\"hu\", y, x))\n", + " elif (x, y-1) not in to_check:\n", + " to_check.append((x, y-1))\n", + "\n", + " if y == h-1:\n", + " fence += 1 # border fence\n", + " fence_map.add((\"hd\", y+1, x))\n", + " else: # check down\n", + " if grid[y+1][x] != plant:\n", + " fence += 1\n", + " fence_map.add((\"hd\", y+1, x))\n", + " elif (x, y+1) not in to_check:\n", + " to_check.append((x, y+1))\n", + "\n", + " # ic (plant, fence_map)\n", + " sides = fence_sides(fence_map)\n", + "\n", + " return(fence, area, sides)\n", + "\n", + "\n", + "def map_regions(grid: list):\n", + " mapped = dict()\n", + " regions = {} # id: [auto] , {plant: [string], fences: [int], area: [int]}\n", + " regions_id = 0 \n", + " for y, row in enumerate(grid):\n", + " for x, _ in enumerate(row):\n", + " if (x, y) in mapped: continue \n", + " fence, area, sides = find_region(grid, x, y, mapped)\n", + " regions[regions_id] = {\"plant\": grid[y][x], \"fences\": fence, \"area\": area, \"sides\": sides}\n", + " regions_id += 1\n", + " return regions\n", + "\n", + "with open(\"input.txt\",\"r\") as file:\n", + " # file = test.splitlines() # decomment to use test\n", + " garden = [list(c) for c in [line.strip() for line in file]]\n", + "\n", + " regions = map_regions(garden)\n", + "\n", + " #ic(regions)\n", + "\n", + " ret1 = sum(r[\"fences\"] * r[\"area\"] for r in regions.values())\n", + " ret2 = sum(r[\"sides\"] * r[\"area\"] for r in regions.values())\n", + "\n", + "\n", + "print (f\"The solution of for part 1 is: {ret1}\")\n", + "print (f\"The solution of for part 2 is: {ret2}\")\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day12/input.txt b/solutions/alv67/day12/input.txt new file mode 100644 index 0000000..c3fb61a --- /dev/null +++ b/solutions/alv67/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MMMMMMMMMMMTTTTTTTXXFNNFFCFFFHHFFUUUUUOOOOODDRRRRRRRRGGGVVJJJJJJJJJJJJJRRRRRRRRR +OOOOOOGCCJJJJJJJJJJJJJJHHJHGGGGGGGGGGGGGGGHHHHHHHHHHHHMMMMMMMMMMMMMMMMMTTTTTTTXXFNNFFCFFHHHBFUUUUUOOOOOODRRRRRARGGVVVYJJJJJJJJJFJJRRRRRRRRRR diff --git a/solutions/alv67/day13/day13.ipynb b/solutions/alv67/day13/day13.ipynb new file mode 100644 index 0000000..33e973f --- /dev/null +++ b/solutions/alv67/day13/day13.ipynb @@ -0,0 +1,141 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# -- Day 13: Claw Contraption --\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 1 is: 34393\n", + "The solution of for part 2 is: 83551068361379\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "# from icecream import ic\n", + "import re\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "#filename = \"test.txt\" # decomment to use test\n", + "\n", + "COST_A = 3 # cost of pressing button A\n", + "COST_B = 1 # cost of pressing button B\n", + "MAX_PRESSES = 100 # maximum number of presses for each button\n", + "PRIZE_OFFSET = 10000000000000 # offset for the prize for part 2\n", + "\n", + "def mat_solution(rule, prize_offset=0):\n", + " \"\"\"\n", + " Formule resolution (found by hand):\n", + " kb = (ax*py - ay*px) / (by*ax - bx*ay)\n", + " ka = (px - kb*bx) / ax\n", + " Accepted only if ka and kb are natural numbers (no rational part)\n", + " \"\"\"\n", + " solution = None\n", + " ax, ay = rule[\"A\"]\n", + " bx, by = rule[\"B\"]\n", + " px, py = rule[\"Prize\"]\n", + " px = px + prize_offset\n", + " py = py + prize_offset\n", + "\n", + " kb, resto = divmod(ax*py - ay*px , by*ax - bx*ay)\n", + "\n", + " if not resto:\n", + " ka, r = divmod(px - kb*bx, ax)\n", + " if not r:\n", + " cost = COST_A*ka + COST_B*kb\n", + " solution = cost\n", + " return solution\n", + "\n", + "\n", + "def parse_file(file_path):\n", + " result = []\n", + "\n", + " with open(file_path, 'r') as file:\n", + " lines = file.readlines()\n", + "\n", + " # Group lines in sets of 3 (Button A, Button B, Prize)\n", + " for i in range(0, len(lines), 4):\n", + " try:\n", + " # Extracting data for Button A\n", + " button_a_match = re.search(r\"Button A: X\\+([0-9]+), Y\\+([0-9]+)\", lines[i])\n", + " ax, ay = int(button_a_match.group(1)), int(button_a_match.group(2))\n", + "\n", + " # Extracting data for Button B\n", + " button_b_match = re.search(r\"Button B: X\\+([0-9]+), Y\\+([0-9]+)\", lines[i + 1])\n", + " bx, by = int(button_b_match.group(1)), int(button_b_match.group(2))\n", + "\n", + " # Extracting data for Prize\n", + " prize_match = re.search(r\"Prize: X=([0-9]+), Y=([0-9]+)\", lines[i + 2])\n", + " px, py = int(prize_match.group(1)), int(prize_match.group(2))\n", + "\n", + " # Append the parsed data to the result list\n", + " result.append({\n", + " \"A\": (ax, ay),\n", + " \"B\": (bx, by),\n", + " \"Prize\": (px, py)\n", + " })\n", + " except (IndexError, AttributeError):\n", + " # Handle cases where the file structure is unexpected\n", + " print(f\"Error parsing block starting at line {i}: {lines[i:i+3]}\")\n", + "\n", + " return result\n", + "\n", + "# ---- main -----\n", + "ret1 = 0\n", + "ret2 = 0\n", + "\n", + "rules = parse_file(filename)\n", + "\n", + "for rule in rules:\n", + " solution = mat_solution(rule)\n", + " if solution:\n", + " ret1 += solution\n", + "\n", + "print (f\"The solution of for part 1 is: {ret1}\")\n", + "\n", + "for rule in rules:\n", + " solution = mat_solution(rule,prize_offset=PRIZE_OFFSET)\n", + " if solution:\n", + " ret2 += solution\n", + "\n", + "print (f\"The solution of for part 2 is: {ret2}\")\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day13/input.txt b/solutions/alv67/day13/input.txt new file mode 100644 index 0000000..07ab6c7 --- /dev/null +++ b/solutions/alv67/day13/input.txt @@ -0,0 +1,1279 @@ +Button A: X+23, Y+97 +Button B: X+93, Y+12 +Prize: X=6993, Y=2877 + +Button A: X+69, Y+13 +Button B: X+16, Y+78 +Prize: X=16314, Y=9324 + +Button A: X+16, Y+43 +Button B: X+40, Y+12 +Prize: X=17664, Y=2838 + +Button A: X+73, Y+29 +Button B: X+24, Y+94 +Prize: X=1335, Y=1375 + +Button A: X+97, Y+37 +Button B: X+32, Y+54 +Prize: X=6457, Y=3675 + +Button A: X+33, Y+97 +Button B: X+89, Y+71 +Prize: X=6726, Y=8334 + +Button A: X+58, Y+34 +Button B: X+13, Y+43 +Prize: X=9979, Y=1021 + +Button A: X+16, Y+51 +Button B: X+66, Y+37 +Prize: X=19072, Y=5135 + +Button A: X+18, Y+70 +Button B: X+54, Y+53 +Prize: X=1980, Y=5816 + +Button A: X+97, Y+26 +Button B: X+49, Y+59 +Prize: X=9823, Y=5018 + +Button A: X+57, Y+15 +Button B: X+12, Y+71 +Prize: X=2807, Y=17918 + +Button A: X+71, Y+69 +Button B: X+11, Y+70 +Prize: X=6976, Y=12236 + +Button A: X+65, Y+71 +Button B: X+54, Y+13 +Prize: X=8680, Y=7182 + +Button A: X+47, Y+91 +Button B: X+27, Y+16 +Prize: X=2812, Y=4066 + +Button A: X+44, Y+19 +Button B: X+24, Y+55 +Prize: X=17644, Y=14291 + +Button A: X+35, Y+17 +Button B: X+15, Y+32 +Prize: X=9210, Y=16679 + +Button A: X+30, Y+78 +Button B: X+87, Y+20 +Prize: X=6375, Y=7296 + +Button A: X+20, Y+49 +Button B: X+85, Y+25 +Prize: X=6480, Y=3415 + +Button A: X+77, Y+56 +Button B: X+30, Y+72 +Prize: X=2785, Y=2176 + +Button A: X+75, Y+24 +Button B: X+13, Y+41 +Prize: X=7774, Y=17595 + +Button A: X+92, Y+31 +Button B: X+29, Y+90 +Prize: X=1617, Y=946 + +Button A: X+67, Y+22 +Button B: X+32, Y+49 +Prize: X=2424, Y=3067 + +Button A: X+45, Y+17 +Button B: X+35, Y+76 +Prize: X=1770, Y=2552 + +Button A: X+59, Y+30 +Button B: X+42, Y+85 +Prize: X=3884, Y=2675 + +Button A: X+16, Y+80 +Button B: X+98, Y+43 +Prize: X=10772, Y=10054 + +Button A: X+44, Y+16 +Button B: X+51, Y+75 +Prize: X=2188, Y=2828 + +Button A: X+44, Y+20 +Button B: X+36, Y+62 +Prize: X=9480, Y=9028 + +Button A: X+61, Y+25 +Button B: X+27, Y+57 +Prize: X=12743, Y=7217 + +Button A: X+56, Y+25 +Button B: X+17, Y+49 +Prize: X=7578, Y=19690 + +Button A: X+80, Y+94 +Button B: X+75, Y+14 +Prize: X=9665, Y=5204 + +Button A: X+67, Y+83 +Button B: X+81, Y+18 +Prize: X=9957, Y=8547 + +Button A: X+46, Y+11 +Button B: X+15, Y+76 +Prize: X=4545, Y=8108 + +Button A: X+91, Y+28 +Button B: X+41, Y+94 +Prize: X=6589, Y=3004 + +Button A: X+76, Y+21 +Button B: X+19, Y+73 +Prize: X=10171, Y=557 + +Button A: X+47, Y+77 +Button B: X+56, Y+28 +Prize: X=10029, Y=10311 + +Button A: X+18, Y+72 +Button B: X+95, Y+17 +Prize: X=9330, Y=6828 + +Button A: X+73, Y+46 +Button B: X+11, Y+27 +Prize: X=7962, Y=2209 + +Button A: X+40, Y+23 +Button B: X+20, Y+52 +Prize: X=16860, Y=16258 + +Button A: X+66, Y+84 +Button B: X+94, Y+24 +Prize: X=7066, Y=4020 + +Button A: X+85, Y+13 +Button B: X+63, Y+95 +Prize: X=9169, Y=5073 + +Button A: X+22, Y+41 +Button B: X+48, Y+13 +Prize: X=19334, Y=16827 + +Button A: X+88, Y+46 +Button B: X+13, Y+82 +Prize: X=3391, Y=5608 + +Button A: X+26, Y+36 +Button B: X+90, Y+33 +Prize: X=8592, Y=3468 + +Button A: X+29, Y+69 +Button B: X+85, Y+52 +Prize: X=3490, Y=4698 + +Button A: X+24, Y+11 +Button B: X+14, Y+44 +Prize: X=990, Y=5512 + +Button A: X+30, Y+55 +Button B: X+54, Y+16 +Prize: X=14540, Y=985 + +Button A: X+27, Y+35 +Button B: X+82, Y+33 +Prize: X=1877, Y=1407 + +Button A: X+81, Y+81 +Button B: X+14, Y+63 +Prize: X=4187, Y=4383 + +Button A: X+37, Y+19 +Button B: X+14, Y+47 +Prize: X=2399, Y=2903 + +Button A: X+15, Y+83 +Button B: X+58, Y+64 +Prize: X=3905, Y=4907 + +Button A: X+14, Y+63 +Button B: X+54, Y+15 +Prize: X=5384, Y=2984 + +Button A: X+11, Y+47 +Button B: X+71, Y+36 +Prize: X=13234, Y=17421 + +Button A: X+55, Y+11 +Button B: X+32, Y+71 +Prize: X=12525, Y=11037 + +Button A: X+17, Y+80 +Button B: X+63, Y+45 +Prize: X=2242, Y=2755 + +Button A: X+18, Y+69 +Button B: X+72, Y+27 +Prize: X=12266, Y=16259 + +Button A: X+97, Y+31 +Button B: X+76, Y+84 +Prize: X=4037, Y=1947 + +Button A: X+12, Y+44 +Button B: X+41, Y+37 +Prize: X=2697, Y=3429 + +Button A: X+19, Y+88 +Button B: X+83, Y+34 +Prize: X=5511, Y=8354 + +Button A: X+17, Y+22 +Button B: X+83, Y+17 +Prize: X=9145, Y=3336 + +Button A: X+24, Y+85 +Button B: X+72, Y+38 +Prize: X=1032, Y=1051 + +Button A: X+18, Y+40 +Button B: X+48, Y+16 +Prize: X=12434, Y=6744 + +Button A: X+47, Y+13 +Button B: X+26, Y+74 +Prize: X=4399, Y=11701 + +Button A: X+19, Y+91 +Button B: X+51, Y+37 +Prize: X=4876, Y=8016 + +Button A: X+68, Y+37 +Button B: X+24, Y+46 +Prize: X=3276, Y=3199 + +Button A: X+13, Y+29 +Button B: X+57, Y+39 +Prize: X=5788, Y=5544 + +Button A: X+24, Y+53 +Button B: X+68, Y+39 +Prize: X=18740, Y=14361 + +Button A: X+51, Y+18 +Button B: X+23, Y+72 +Prize: X=17447, Y=17126 + +Button A: X+39, Y+19 +Button B: X+30, Y+60 +Prize: X=3491, Y=10211 + +Button A: X+85, Y+24 +Button B: X+23, Y+94 +Prize: X=2812, Y=8582 + +Button A: X+29, Y+69 +Button B: X+58, Y+21 +Prize: X=10443, Y=4862 + +Button A: X+27, Y+44 +Button B: X+95, Y+31 +Prize: X=894, Y=714 + +Button A: X+87, Y+54 +Button B: X+48, Y+99 +Prize: X=8262, Y=5751 + +Button A: X+23, Y+70 +Button B: X+44, Y+12 +Prize: X=4080, Y=5956 + +Button A: X+12, Y+52 +Button B: X+82, Y+23 +Prize: X=15086, Y=14567 + +Button A: X+37, Y+12 +Button B: X+16, Y+43 +Prize: X=14856, Y=930 + +Button A: X+11, Y+77 +Button B: X+69, Y+16 +Prize: X=13006, Y=5385 + +Button A: X+23, Y+51 +Button B: X+41, Y+11 +Prize: X=8141, Y=11813 + +Button A: X+56, Y+12 +Button B: X+37, Y+84 +Prize: X=5392, Y=10244 + +Button A: X+41, Y+12 +Button B: X+21, Y+97 +Prize: X=2070, Y=4240 + +Button A: X+55, Y+97 +Button B: X+77, Y+31 +Prize: X=11418, Y=10286 + +Button A: X+11, Y+52 +Button B: X+64, Y+14 +Prize: X=1788, Y=18898 + +Button A: X+64, Y+13 +Button B: X+18, Y+98 +Prize: X=4300, Y=2949 + +Button A: X+31, Y+70 +Button B: X+68, Y+38 +Prize: X=917, Y=1724 + +Button A: X+12, Y+22 +Button B: X+96, Y+38 +Prize: X=10188, Y=5706 + +Button A: X+49, Y+11 +Button B: X+12, Y+62 +Prize: X=15408, Y=11956 + +Button A: X+71, Y+56 +Button B: X+25, Y+91 +Prize: X=1469, Y=2513 + +Button A: X+15, Y+47 +Button B: X+66, Y+12 +Prize: X=2153, Y=10113 + +Button A: X+13, Y+62 +Button B: X+79, Y+85 +Prize: X=6430, Y=9367 + +Button A: X+18, Y+77 +Button B: X+44, Y+12 +Prize: X=10844, Y=2702 + +Button A: X+93, Y+35 +Button B: X+26, Y+58 +Prize: X=8896, Y=6048 + +Button A: X+39, Y+38 +Button B: X+55, Y+12 +Prize: X=3970, Y=3078 + +Button A: X+74, Y+74 +Button B: X+91, Y+21 +Prize: X=11192, Y=6852 + +Button A: X+60, Y+39 +Button B: X+32, Y+65 +Prize: X=4848, Y=4212 + +Button A: X+85, Y+64 +Button B: X+11, Y+40 +Prize: X=5294, Y=6016 + +Button A: X+50, Y+91 +Button B: X+65, Y+14 +Prize: X=10540, Y=10213 + +Button A: X+76, Y+22 +Button B: X+11, Y+66 +Prize: X=7809, Y=3840 + +Button A: X+21, Y+41 +Button B: X+40, Y+18 +Prize: X=14542, Y=14586 + +Button A: X+92, Y+71 +Button B: X+24, Y+85 +Prize: X=3776, Y=6238 + +Button A: X+56, Y+87 +Button B: X+86, Y+23 +Prize: X=7110, Y=3414 + +Button A: X+92, Y+42 +Button B: X+19, Y+81 +Prize: X=701, Y=537 + +Button A: X+26, Y+59 +Button B: X+56, Y+21 +Prize: X=2004, Y=3633 + +Button A: X+77, Y+11 +Button B: X+12, Y+57 +Prize: X=15477, Y=3321 + +Button A: X+41, Y+16 +Button B: X+23, Y+68 +Prize: X=1951, Y=9676 + +Button A: X+51, Y+89 +Button B: X+89, Y+29 +Prize: X=2824, Y=1644 + +Button A: X+15, Y+47 +Button B: X+41, Y+13 +Prize: X=16130, Y=3046 + +Button A: X+83, Y+19 +Button B: X+94, Y+92 +Prize: X=7904, Y=5122 + +Button A: X+31, Y+91 +Button B: X+51, Y+14 +Prize: X=2361, Y=5845 + +Button A: X+50, Y+46 +Button B: X+15, Y+55 +Prize: X=2960, Y=2888 + +Button A: X+21, Y+58 +Button B: X+68, Y+35 +Prize: X=2525, Y=8683 + +Button A: X+33, Y+18 +Button B: X+19, Y+50 +Prize: X=11199, Y=13498 + +Button A: X+65, Y+27 +Button B: X+32, Y+70 +Prize: X=305, Y=4371 + +Button A: X+63, Y+17 +Button B: X+12, Y+63 +Prize: X=12848, Y=11817 + +Button A: X+64, Y+21 +Button B: X+15, Y+38 +Prize: X=15433, Y=14539 + +Button A: X+23, Y+38 +Button B: X+95, Y+34 +Prize: X=5009, Y=4710 + +Button A: X+21, Y+43 +Button B: X+48, Y+22 +Prize: X=5945, Y=5653 + +Button A: X+36, Y+66 +Button B: X+45, Y+19 +Prize: X=9548, Y=6616 + +Button A: X+11, Y+88 +Button B: X+18, Y+11 +Prize: X=2567, Y=7502 + +Button A: X+63, Y+15 +Button B: X+18, Y+79 +Prize: X=9071, Y=2005 + +Button A: X+96, Y+20 +Button B: X+21, Y+34 +Prize: X=8250, Y=3200 + +Button A: X+16, Y+53 +Button B: X+63, Y+49 +Prize: X=3317, Y=4121 + +Button A: X+14, Y+44 +Button B: X+62, Y+39 +Prize: X=2814, Y=3389 + +Button A: X+27, Y+11 +Button B: X+25, Y+66 +Prize: X=9498, Y=760 + +Button A: X+49, Y+18 +Button B: X+19, Y+47 +Prize: X=13964, Y=7779 + +Button A: X+63, Y+38 +Button B: X+17, Y+50 +Prize: X=3851, Y=3078 + +Button A: X+13, Y+73 +Button B: X+58, Y+21 +Prize: X=3753, Y=6754 + +Button A: X+62, Y+62 +Button B: X+12, Y+89 +Prize: X=1748, Y=8986 + +Button A: X+58, Y+30 +Button B: X+18, Y+52 +Prize: X=7412, Y=10326 + +Button A: X+51, Y+15 +Button B: X+33, Y+79 +Prize: X=2351, Y=18625 + +Button A: X+41, Y+12 +Button B: X+14, Y+63 +Prize: X=6251, Y=9782 + +Button A: X+71, Y+41 +Button B: X+11, Y+98 +Prize: X=4898, Y=8144 + +Button A: X+25, Y+11 +Button B: X+37, Y+68 +Prize: X=13265, Y=13700 + +Button A: X+16, Y+87 +Button B: X+34, Y+23 +Prize: X=1622, Y=1859 + +Button A: X+45, Y+14 +Button B: X+21, Y+65 +Prize: X=6593, Y=8788 + +Button A: X+12, Y+34 +Button B: X+56, Y+20 +Prize: X=14292, Y=10894 + +Button A: X+97, Y+71 +Button B: X+32, Y+74 +Prize: X=7508, Y=9390 + +Button A: X+91, Y+94 +Button B: X+99, Y+26 +Prize: X=10533, Y=6762 + +Button A: X+91, Y+79 +Button B: X+77, Y+14 +Prize: X=13720, Y=8053 + +Button A: X+97, Y+65 +Button B: X+35, Y+73 +Prize: X=10273, Y=8519 + +Button A: X+52, Y+56 +Button B: X+12, Y+60 +Prize: X=3076, Y=5384 + +Button A: X+24, Y+78 +Button B: X+87, Y+80 +Prize: X=1914, Y=5004 + +Button A: X+25, Y+64 +Button B: X+86, Y+40 +Prize: X=7861, Y=6432 + +Button A: X+76, Y+18 +Button B: X+11, Y+67 +Prize: X=4187, Y=6341 + +Button A: X+16, Y+54 +Button B: X+73, Y+11 +Prize: X=11779, Y=14913 + +Button A: X+61, Y+11 +Button B: X+71, Y+61 +Prize: X=6710, Y=4150 + +Button A: X+13, Y+23 +Button B: X+45, Y+18 +Prize: X=10234, Y=5208 + +Button A: X+33, Y+14 +Button B: X+37, Y+70 +Prize: X=9190, Y=4372 + +Button A: X+55, Y+84 +Button B: X+91, Y+30 +Prize: X=8397, Y=3888 + +Button A: X+54, Y+27 +Button B: X+40, Y+69 +Prize: X=13734, Y=4685 + +Button A: X+56, Y+42 +Button B: X+38, Y+96 +Prize: X=3582, Y=4374 + +Button A: X+68, Y+28 +Button B: X+62, Y+94 +Prize: X=5090, Y=5314 + +Button A: X+79, Y+42 +Button B: X+33, Y+87 +Prize: X=1238, Y=936 + +Button A: X+13, Y+73 +Button B: X+76, Y+53 +Prize: X=2245, Y=2141 + +Button A: X+98, Y+43 +Button B: X+50, Y+80 +Prize: X=10578, Y=9983 + +Button A: X+83, Y+29 +Button B: X+20, Y+49 +Prize: X=8704, Y=5982 + +Button A: X+17, Y+83 +Button B: X+75, Y+13 +Prize: X=10144, Y=13144 + +Button A: X+43, Y+12 +Button B: X+33, Y+71 +Prize: X=6221, Y=8450 + +Button A: X+61, Y+27 +Button B: X+23, Y+44 +Prize: X=2473, Y=3834 + +Button A: X+19, Y+77 +Button B: X+68, Y+14 +Prize: X=8635, Y=14655 + +Button A: X+35, Y+97 +Button B: X+80, Y+47 +Prize: X=6060, Y=9981 + +Button A: X+92, Y+28 +Button B: X+48, Y+86 +Prize: X=12368, Y=10118 + +Button A: X+17, Y+63 +Button B: X+94, Y+41 +Prize: X=3401, Y=6764 + +Button A: X+13, Y+28 +Button B: X+57, Y+21 +Prize: X=10116, Y=2580 + +Button A: X+54, Y+16 +Button B: X+19, Y+65 +Prize: X=17693, Y=18057 + +Button A: X+36, Y+18 +Button B: X+18, Y+56 +Prize: X=818, Y=10166 + +Button A: X+30, Y+11 +Button B: X+48, Y+68 +Prize: X=680, Y=18576 + +Button A: X+53, Y+63 +Button B: X+58, Y+14 +Prize: X=6464, Y=2464 + +Button A: X+43, Y+19 +Button B: X+33, Y+59 +Prize: X=6935, Y=3385 + +Button A: X+78, Y+42 +Button B: X+18, Y+50 +Prize: X=6188, Y=19540 + +Button A: X+17, Y+65 +Button B: X+91, Y+27 +Prize: X=2552, Y=2376 + +Button A: X+15, Y+15 +Button B: X+53, Y+12 +Prize: X=4378, Y=2082 + +Button A: X+95, Y+57 +Button B: X+31, Y+71 +Prize: X=3543, Y=4903 + +Button A: X+11, Y+39 +Button B: X+36, Y+11 +Prize: X=16328, Y=10583 + +Button A: X+20, Y+96 +Button B: X+33, Y+34 +Prize: X=658, Y=2412 + +Button A: X+16, Y+36 +Button B: X+57, Y+34 +Prize: X=2414, Y=10800 + +Button A: X+17, Y+96 +Button B: X+58, Y+19 +Prize: X=2396, Y=4583 + +Button A: X+54, Y+19 +Button B: X+15, Y+33 +Prize: X=830, Y=13495 + +Button A: X+67, Y+21 +Button B: X+11, Y+36 +Prize: X=15009, Y=7019 + +Button A: X+60, Y+13 +Button B: X+97, Y+94 +Prize: X=5471, Y=2864 + +Button A: X+30, Y+53 +Button B: X+32, Y+16 +Prize: X=7992, Y=5652 + +Button A: X+16, Y+48 +Button B: X+58, Y+11 +Prize: X=3442, Y=9359 + +Button A: X+31, Y+65 +Button B: X+92, Y+17 +Prize: X=5690, Y=4015 + +Button A: X+15, Y+42 +Button B: X+61, Y+41 +Prize: X=5312, Y=11057 + +Button A: X+30, Y+12 +Button B: X+40, Y+69 +Prize: X=13180, Y=10529 + +Button A: X+36, Y+88 +Button B: X+52, Y+15 +Prize: X=3644, Y=2293 + +Button A: X+22, Y+41 +Button B: X+48, Y+27 +Prize: X=14570, Y=13331 + +Button A: X+17, Y+75 +Button B: X+25, Y+26 +Prize: X=2776, Y=7358 + +Button A: X+12, Y+69 +Button B: X+55, Y+14 +Prize: X=14183, Y=12248 + +Button A: X+25, Y+14 +Button B: X+23, Y+51 +Prize: X=14705, Y=18449 + +Button A: X+47, Y+35 +Button B: X+32, Y+79 +Prize: X=3796, Y=3213 + +Button A: X+49, Y+22 +Button B: X+26, Y+63 +Prize: X=14674, Y=2732 + +Button A: X+17, Y+81 +Button B: X+70, Y+12 +Prize: X=11287, Y=5867 + +Button A: X+25, Y+65 +Button B: X+75, Y+57 +Prize: X=3550, Y=3848 + +Button A: X+63, Y+16 +Button B: X+59, Y+85 +Prize: X=5698, Y=5368 + +Button A: X+39, Y+67 +Button B: X+71, Y+19 +Prize: X=2629, Y=2457 + +Button A: X+49, Y+24 +Button B: X+12, Y+51 +Prize: X=8580, Y=13931 + +Button A: X+30, Y+63 +Button B: X+70, Y+15 +Prize: X=3420, Y=3618 + +Button A: X+21, Y+58 +Button B: X+63, Y+33 +Prize: X=14774, Y=8692 + +Button A: X+63, Y+32 +Button B: X+15, Y+76 +Prize: X=3012, Y=2624 + +Button A: X+39, Y+17 +Button B: X+43, Y+89 +Prize: X=3593, Y=2339 + +Button A: X+17, Y+37 +Button B: X+75, Y+47 +Prize: X=13809, Y=19685 + +Button A: X+26, Y+59 +Button B: X+63, Y+20 +Prize: X=5513, Y=3780 + +Button A: X+16, Y+80 +Button B: X+21, Y+18 +Prize: X=1089, Y=1530 + +Button A: X+15, Y+50 +Button B: X+53, Y+26 +Prize: X=1032, Y=7684 + +Button A: X+25, Y+46 +Button B: X+54, Y+22 +Prize: X=13051, Y=15284 + +Button A: X+58, Y+49 +Button B: X+20, Y+81 +Prize: X=1126, Y=3259 + +Button A: X+16, Y+43 +Button B: X+32, Y+17 +Prize: X=9872, Y=14960 + +Button A: X+72, Y+18 +Button B: X+49, Y+95 +Prize: X=4374, Y=5562 + +Button A: X+96, Y+24 +Button B: X+40, Y+70 +Prize: X=8040, Y=5430 + +Button A: X+25, Y+51 +Button B: X+56, Y+15 +Prize: X=4219, Y=1263 + +Button A: X+40, Y+98 +Button B: X+88, Y+43 +Prize: X=4064, Y=3398 + +Button A: X+16, Y+22 +Button B: X+82, Y+27 +Prize: X=6482, Y=2653 + +Button A: X+88, Y+14 +Button B: X+40, Y+60 +Prize: X=5880, Y=2330 + +Button A: X+30, Y+74 +Button B: X+55, Y+20 +Prize: X=2405, Y=16892 + +Button A: X+18, Y+47 +Button B: X+62, Y+12 +Prize: X=19226, Y=2795 + +Button A: X+50, Y+18 +Button B: X+38, Y+58 +Prize: X=4712, Y=6084 + +Button A: X+14, Y+39 +Button B: X+63, Y+35 +Prize: X=14746, Y=8492 + +Button A: X+59, Y+13 +Button B: X+35, Y+85 +Prize: X=595, Y=9525 + +Button A: X+42, Y+22 +Button B: X+36, Y+62 +Prize: X=2822, Y=9926 + +Button A: X+45, Y+55 +Button B: X+94, Y+22 +Prize: X=6660, Y=3960 + +Button A: X+41, Y+90 +Button B: X+50, Y+32 +Prize: X=5513, Y=6270 + +Button A: X+84, Y+74 +Button B: X+12, Y+37 +Prize: X=4500, Y=5735 + +Button A: X+31, Y+49 +Button B: X+48, Y+13 +Prize: X=3595, Y=4425 + +Button A: X+99, Y+18 +Button B: X+31, Y+73 +Prize: X=4116, Y=2163 + +Button A: X+56, Y+31 +Button B: X+29, Y+53 +Prize: X=4032, Y=16493 + +Button A: X+45, Y+77 +Button B: X+50, Y+18 +Prize: X=18500, Y=2116 + +Button A: X+81, Y+17 +Button B: X+48, Y+65 +Prize: X=12237, Y=7951 + +Button A: X+48, Y+57 +Button B: X+98, Y+16 +Prize: X=10492, Y=6236 + +Button A: X+70, Y+12 +Button B: X+14, Y+78 +Prize: X=17210, Y=9854 + +Button A: X+53, Y+86 +Button B: X+45, Y+13 +Prize: X=18553, Y=8777 + +Button A: X+15, Y+34 +Button B: X+72, Y+46 +Prize: X=17951, Y=17142 + +Button A: X+26, Y+43 +Button B: X+77, Y+26 +Prize: X=4778, Y=4659 + +Button A: X+12, Y+66 +Button B: X+59, Y+44 +Prize: X=3031, Y=5170 + +Button A: X+26, Y+14 +Button B: X+20, Y+58 +Prize: X=1516, Y=4028 + +Button A: X+60, Y+13 +Button B: X+13, Y+51 +Prize: X=15963, Y=14692 + +Button A: X+67, Y+16 +Button B: X+11, Y+25 +Prize: X=680, Y=319 + +Button A: X+56, Y+20 +Button B: X+15, Y+66 +Prize: X=7292, Y=19232 + +Button A: X+13, Y+96 +Button B: X+80, Y+48 +Prize: X=1498, Y=6720 + +Button A: X+35, Y+44 +Button B: X+11, Y+91 +Prize: X=2406, Y=5417 + +Button A: X+59, Y+23 +Button B: X+23, Y+47 +Prize: X=3805, Y=10093 + +Button A: X+17, Y+65 +Button B: X+99, Y+97 +Prize: X=5914, Y=9662 + +Button A: X+41, Y+83 +Button B: X+47, Y+12 +Prize: X=3330, Y=1503 + +Button A: X+46, Y+11 +Button B: X+22, Y+51 +Prize: X=12508, Y=3726 + +Button A: X+62, Y+21 +Button B: X+18, Y+43 +Prize: X=6706, Y=5563 + +Button A: X+41, Y+55 +Button B: X+51, Y+20 +Prize: X=3715, Y=1885 + +Button A: X+14, Y+41 +Button B: X+64, Y+29 +Prize: X=18418, Y=19077 + +Button A: X+37, Y+16 +Button B: X+33, Y+47 +Prize: X=17950, Y=4251 + +Button A: X+24, Y+68 +Button B: X+91, Y+66 +Prize: X=6172, Y=7512 + +Button A: X+53, Y+96 +Button B: X+62, Y+15 +Prize: X=10393, Y=10749 + +Button A: X+44, Y+27 +Button B: X+20, Y+97 +Prize: X=2676, Y=7573 + +Button A: X+14, Y+37 +Button B: X+97, Y+44 +Prize: X=4964, Y=2926 + +Button A: X+20, Y+55 +Button B: X+40, Y+17 +Prize: X=13460, Y=13556 + +Button A: X+63, Y+33 +Button B: X+34, Y+63 +Prize: X=6045, Y=644 + +Button A: X+48, Y+82 +Button B: X+60, Y+33 +Prize: X=4152, Y=3896 + +Button A: X+18, Y+87 +Button B: X+95, Y+24 +Prize: X=3820, Y=7149 + +Button A: X+90, Y+47 +Button B: X+18, Y+41 +Prize: X=5688, Y=5530 + +Button A: X+94, Y+34 +Button B: X+18, Y+72 +Prize: X=5798, Y=6092 + +Button A: X+37, Y+11 +Button B: X+36, Y+68 +Prize: X=1009, Y=9527 + +Button A: X+82, Y+53 +Button B: X+13, Y+36 +Prize: X=6514, Y=8211 + +Button A: X+37, Y+12 +Button B: X+24, Y+49 +Prize: X=19416, Y=15591 + +Button A: X+70, Y+60 +Button B: X+17, Y+50 +Prize: X=7214, Y=8380 + +Button A: X+67, Y+11 +Button B: X+12, Y+16 +Prize: X=5442, Y=1146 + +Button A: X+47, Y+99 +Button B: X+77, Y+46 +Prize: X=1351, Y=1800 + +Button A: X+74, Y+33 +Button B: X+46, Y+90 +Prize: X=5668, Y=5724 + +Button A: X+51, Y+81 +Button B: X+61, Y+25 +Prize: X=5878, Y=6676 + +Button A: X+29, Y+93 +Button B: X+97, Y+25 +Prize: X=10685, Y=6517 + +Button A: X+83, Y+89 +Button B: X+67, Y+17 +Prize: X=4108, Y=3692 + +Button A: X+18, Y+46 +Button B: X+66, Y+18 +Prize: X=17690, Y=9366 + +Button A: X+75, Y+90 +Button B: X+12, Y+91 +Prize: X=7860, Y=15560 + +Button A: X+21, Y+72 +Button B: X+72, Y+17 +Prize: X=18143, Y=1514 + +Button A: X+33, Y+15 +Button B: X+34, Y+50 +Prize: X=11081, Y=12875 + +Button A: X+40, Y+19 +Button B: X+15, Y+39 +Prize: X=7060, Y=11866 + +Button A: X+56, Y+41 +Button B: X+17, Y+39 +Prize: X=12452, Y=429 + +Button A: X+67, Y+81 +Button B: X+13, Y+79 +Prize: X=3428, Y=8764 + +Button A: X+20, Y+51 +Button B: X+67, Y+23 +Prize: X=13378, Y=19419 + +Button A: X+61, Y+42 +Button B: X+12, Y+38 +Prize: X=6443, Y=2700 + +Button A: X+13, Y+41 +Button B: X+66, Y+29 +Prize: X=16250, Y=275 + +Button A: X+47, Y+12 +Button B: X+25, Y+70 +Prize: X=3405, Y=3650 + +Button A: X+95, Y+60 +Button B: X+23, Y+79 +Prize: X=4259, Y=6107 + +Button A: X+52, Y+18 +Button B: X+19, Y+59 +Prize: X=3656, Y=3428 + +Button A: X+33, Y+24 +Button B: X+30, Y+78 +Prize: X=3399, Y=7416 + +Button A: X+27, Y+19 +Button B: X+14, Y+34 +Prize: X=5847, Y=1191 + +Button A: X+93, Y+17 +Button B: X+66, Y+64 +Prize: X=10617, Y=3343 + +Button A: X+17, Y+62 +Button B: X+27, Y+12 +Prize: X=4316, Y=8096 + +Button A: X+13, Y+50 +Button B: X+62, Y+29 +Prize: X=19495, Y=19244 + +Button A: X+26, Y+56 +Button B: X+93, Y+60 +Prize: X=647, Y=692 + +Button A: X+91, Y+50 +Button B: X+34, Y+90 +Prize: X=9264, Y=8870 + +Button A: X+15, Y+34 +Button B: X+97, Y+59 +Prize: X=4151, Y=3296 + +Button A: X+81, Y+71 +Button B: X+13, Y+78 +Prize: X=1450, Y=4135 + +Button A: X+16, Y+45 +Button B: X+60, Y+39 +Prize: X=5084, Y=4856 + +Button A: X+48, Y+82 +Button B: X+90, Y+37 +Prize: X=11112, Y=10110 + +Button A: X+28, Y+72 +Button B: X+87, Y+40 +Prize: X=6010, Y=4064 + +Button A: X+94, Y+12 +Button B: X+30, Y+88 +Prize: X=1876, Y=4448 + +Button A: X+11, Y+86 +Button B: X+97, Y+84 +Prize: X=1455, Y=8678 + +Button A: X+14, Y+51 +Button B: X+69, Y+29 +Prize: X=14379, Y=14593 + +Button A: X+21, Y+79 +Button B: X+94, Y+71 +Prize: X=1611, Y=2669 + +Button A: X+75, Y+46 +Button B: X+12, Y+26 +Prize: X=5360, Y=5142 + +Button A: X+76, Y+43 +Button B: X+30, Y+76 +Prize: X=8082, Y=9708 + +Button A: X+32, Y+99 +Button B: X+28, Y+14 +Prize: X=1068, Y=2360 + +Button A: X+23, Y+63 +Button B: X+49, Y+22 +Prize: X=19299, Y=13706 + +Button A: X+87, Y+24 +Button B: X+46, Y+98 +Prize: X=11245, Y=8306 + +Button A: X+96, Y+50 +Button B: X+23, Y+61 +Prize: X=9190, Y=8414 + +Button A: X+22, Y+77 +Button B: X+74, Y+12 +Prize: X=13870, Y=16135 + +Button A: X+87, Y+52 +Button B: X+33, Y+98 +Prize: X=5268, Y=6358 + +Button A: X+28, Y+79 +Button B: X+48, Y+37 +Prize: X=2100, Y=4547 + +Button A: X+44, Y+83 +Button B: X+57, Y+15 +Prize: X=9033, Y=8805 + +Button A: X+32, Y+76 +Button B: X+42, Y+21 +Prize: X=4042, Y=4481 + +Button A: X+73, Y+11 +Button B: X+78, Y+68 +Prize: X=12004, Y=7096 + +Button A: X+59, Y+19 +Button B: X+12, Y+56 +Prize: X=15540, Y=13528 + +Button A: X+46, Y+28 +Button B: X+12, Y+44 +Prize: X=19412, Y=3044 + +Button A: X+14, Y+24 +Button B: X+46, Y+21 +Prize: X=16360, Y=995 + +Button A: X+29, Y+50 +Button B: X+23, Y+13 +Prize: X=15789, Y=7136 + +Button A: X+12, Y+48 +Button B: X+81, Y+40 +Prize: X=9497, Y=8424 + +Button A: X+70, Y+16 +Button B: X+11, Y+46 +Prize: X=9728, Y=16688 + +Button A: X+64, Y+39 +Button B: X+18, Y+42 +Prize: X=5064, Y=3210 + +Button A: X+12, Y+42 +Button B: X+95, Y+67 +Prize: X=6954, Y=6816 + +Button A: X+71, Y+26 +Button B: X+58, Y+78 +Prize: X=6368, Y=3978 + +Button A: X+34, Y+21 +Button B: X+25, Y+48 +Prize: X=8873, Y=2960 + +Button A: X+13, Y+44 +Button B: X+82, Y+46 +Prize: X=8218, Y=14754 + +Button A: X+23, Y+52 +Button B: X+43, Y+13 +Prize: X=4439, Y=7621 + +Button A: X+57, Y+22 +Button B: X+30, Y+63 +Prize: X=18083, Y=10440 diff --git a/solutions/alv67/day13/test.txt b/solutions/alv67/day13/test.txt new file mode 100644 index 0000000..912f482 --- /dev/null +++ b/solutions/alv67/day13/test.txt @@ -0,0 +1,15 @@ +Button A: X+94, Y+34 +Button B: X+22, Y+67 +Prize: X=8400, Y=5400 + +Button A: X+26, Y+66 +Button B: X+67, Y+21 +Prize: X=12748, Y=12176 + +Button A: X+17, Y+86 +Button B: X+84, Y+37 +Prize: X=7870, Y=6450 + +Button A: X+69, Y+23 +Button B: X+27, Y+71 +Prize: X=18641, Y=10279 diff --git a/solutions/alv67/day14/day14.ipynb b/solutions/alv67/day14/day14.ipynb new file mode 100644 index 0000000..b219408 --- /dev/null +++ b/solutions/alv67/day14/day14.ipynb @@ -0,0 +1,193 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 14: Restroom Redoubt ---\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 1 is: 212975730\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "# from icecream import ic\n", + "import re\n", + "import time\n", + "from IPython.display import clear_output\n", + "import tkinter as tk\n", + "\n", + "puzzle = {\"filename\": \"input.txt\", \"width\": 101, \"height\": 103}\n", + "\n", + "# decomment next line for test\n", + "# puzzle = {\"filename\": \"test.txt\", \"width\": 11, \"height\": 7} #\n", + "\n", + "\n", + "class Robot:\n", + " def __init__(self, x, y, vx, vy, room_instance):\n", + " self.x = x\n", + " self.y = y\n", + " self.vx = vx\n", + " self.vy = vy\n", + " self.room = room_instance\n", + "\n", + " def position(self):\n", + " return (self.x, self.y)\n", + "\n", + " def move(self, steps = 1):\n", + " self.x += self.vx * steps \n", + " self.x = self.x % self.room.width\n", + " self.y += self.vy * steps\n", + " self.y = self.y % self.room.height\n", + "\n", + "class Room:\n", + "\n", + " def __init__(self, width, height): \n", + " self.width = width\n", + " self.height = height\n", + " self.robots = []\n", + " self.abyss = 0\n", + " self.sand = 0\n", + "\n", + " def add_robot(self, x, y, vx, vy):\n", + " robot_instance = Robot(x, y, vx, vy, self)\n", + " self.robots.append(robot_instance)\n", + "\n", + " def time_step(self, seconds = 1):\n", + " for robot in self.robots:\n", + " robot.move(seconds)\n", + "\n", + " def safety_factor(self):\n", + " \"\"\" \n", + " count robots in each quadrant (robot exactly in the middle do not count)\n", + " The safety factor is the multiplicationof those 4 counts\n", + " \"\"\"\n", + " quad_w = self.width//2\n", + " quad_h = self.height//2\n", + " positions = [robot.position() for robot in self.robots]\n", + "\n", + " q1 = len([r for r in positions if r[0]quad_w and r[1]quad_w and r[1]>quad_h])\n", + " q4 = len([r for r in positions if r[0]quad_h])\n", + "\n", + " return q1 * q2 * q3 * q4\n", + " \n", + " def __str__(self):\n", + " # extract robot positions\n", + " retstr = \"\"\n", + " robot_positions = [robot.position() for robot in self.robots]\n", + " for y in range(self.height):\n", + " for x in range(self.width):\n", + " n = robot_positions.count((x, y))\n", + " if n == 0:\n", + " retstr += \".\"\n", + " else:\n", + " retstr += str(n)\n", + " retstr += '\\n'\n", + " return retstr\n", + "\n", + "def draw_map(canvas, char_map):\n", + " \"\"\"Disegna la mappa sul canvas.\"\"\"\n", + " canvas.delete(\"all\") # Pulisci il canvas\n", + " for y, row in enumerate(char_map):\n", + " for x, char in enumerate(row):\n", + " canvas.create_text(\n", + " x * 15, # Posizione x\n", + " y * 15, # Posizione y\n", + " text=char,\n", + " font=(\"Courier\", 14),\n", + " anchor=\"nw\" # Inizia il testo dall'angolo in alto a sinistra\n", + " )\n", + "\n", + "def update_map(canvas, root, new_map):\n", + " \"\"\"Aggiorna la mappa e ridisegna.\"\"\"\n", + " # new_map = generate_map() # Genera una nuova mappa\n", + " draw_map(canvas, new_map) # Disegna la mappa sul canvas\n", + " root.after(500, update_map, canvas, root) # Aggiorna dopo 500ms\n", + "\n", + "# ---- main -----\n", + "\n", + "pattern = r\"p=(-?\\d+),(-?\\d+)\\s+v=(-?\\d+),(-?\\d+)\"\n", + "\n", + "robot_list = []\n", + "\n", + "with open(puzzle[\"filename\"], \"r\") as file:\n", + "\n", + " for line in file:\n", + " match = re.match(pattern, line.strip())\n", + " if match:\n", + " x, y, vx, vy = map(int, match.groups())\n", + " robot_list.append((x, y, vx, vy))\n", + "\n", + "restroom = Room(puzzle[\"width\"], puzzle[\"height\"])\n", + "\n", + "for robot in robot_list:\n", + " x,y,vx,vy = robot\n", + " restroom.add_robot(x,y,vx,vy)\n", + "\n", + "#for _ in range(2000):\n", + "# restroom.time_step(2)\n", + "# clear_output()\n", + "# print (restroom)\n", + "# time.sleep(0.5)\n", + "\n", + "\n", + "\n", + "root = tk.Tk()\n", + "root.title(\"Restroom\")\n", + "\n", + "new_map = restroom.__str__()\n", + "\n", + "canvas = tk.Canvas(root,width = puzzle[\"width\"], height = puzzle[\"height\"], bg=\"black\" )\n", + "canvas.pack()\n", + "\n", + "update_map(canvas, root, new_map)\n", + "\n", + "ret1 = restroom.safety_factor()\n", + "\n", + "print (f\"The solution of for part 1 is: {ret1}\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For Part two see `day14.py`" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day14/day14.py b/solutions/alv67/day14/day14.py new file mode 100644 index 0000000..8a4f6c0 --- /dev/null +++ b/solutions/alv67/day14/day14.py @@ -0,0 +1,185 @@ +# --- Part Two --- + +# from icecream import ic +import re +import time +import random +from IPython.display import clear_output +import tkinter as tk + +puzzle = {"filename": "input.txt", "width": 101, "height": 103} + +# decomment next line for test +# puzzle = {"filename": "test.txt", "width": 11, "height": 7} # + + +class Robot: + def __init__(self, x, y, vx, vy, room_instance): + self.x = x + self.y = y + self.vx = vx + self.vy = vy + self.room = room_instance + + def position(self): + return (self.x, self.y) + + def move(self, steps = 1): + self.x += self.vx * steps + self.x = self.x % self.room.width + self.y += self.vy * steps + self.y = self.y % self.room.height + +class Room: + + def __init__(self, width, height): + self.width = width + self.height = height + self.robots = [] + self.abyss = 0 + self.sand = 0 + self.time = 0 + + def add_robot(self, x, y, vx, vy): + robot_instance = Robot(x, y, vx, vy, self) + self.robots.append(robot_instance) + + def time_step(self, seconds = 1): + for robot in self.robots: + robot.move(seconds) + self.time += seconds + + def safety_factor(self): + """ + count robots in each quadrant (robot exactly in the middle do not count) + The safety factor is the multiplicationof those 4 counts + """ + quad_w = self.width//2 + quad_h = self.height//2 + positions = [robot.position() for robot in self.robots] + + q1 = len([r for r in positions if r[0]quad_w and r[1]quad_w and r[1]>quad_h]) + q4 = len([r for r in positions if r[0]quad_h]) + + return q1 * q2 * q3 * q4 + + def get_map(self): + retmap = list() + side2side = list() + robot_positions = [robot.position() for robot in self.robots] + for y in range(self.height): + row = [] + s2s = 0 + s = 0 + for x in range(self.width): + n = robot_positions.count((x, y)) + if n == 0: + if s > s2s: + s2s = s + s=0 + row.append(".") + else: + s+=1 # number of robots side to side + row.append(str(n)) + retmap.append(row) + side2side.append(s2s) + return retmap, max(side2side) + + + + def __str__(self): + # extract robot positions + retstr = "" + robot_positions = [robot.position() for robot in self.robots] + for y in range(self.height): + for x in range(self.width): + n = robot_positions.count((x, y)) + if n == 0: + retstr += "." + else: + retstr += str(n) + retstr += '\n' + return retstr + +# Dimensioni della mappa +MAP_WIDTH = 20 +MAP_HEIGHT = 10 + +# Caratteri per la mappa +CHARS = ['#', '.', '*', ' '] +def generate_map(): + """Genera una nuova mappa casuale.""" + return [[random.choice(CHARS) for _ in range(MAP_WIDTH)] for _ in range(MAP_HEIGHT)] + +def draw_map(canvas, char_map): + """Disegna la mappa sul canvas.""" + canvas.delete("all") # Pulisci il canvas + for y, row in enumerate(char_map): + for x, char in enumerate(row): + canvas.create_text( + x * 9, # Posizione x + y * 9, # Posizione y + text=char, + font=("Courier", 8), + anchor="nw" # Inizia il testo dall'angolo in alto a sinistra + ) + +# def update_map(canvas, root, get_map): +# """Aggiorna la mappa e ridisegna.""" +# new_map = get_map() # Genera una nuova mappa +# draw_map(canvas, new_map) # Disegna la mappa sul canvas +# #root.after(500, update_map, canvas, root) # Aggiorna dopo 500ms + + +def update_map(canvas, root, restroom): + side2side = 0 + new_map = [] + while side2side < 10: + restroom.time_step(1) + new_map, side2side = restroom.get_map() + print (f"\r {restroom.time} - {side2side} ", end="") + print (f"\rtime: {restroom.time} side-2-side: {side2side}") + draw_map(canvas, new_map) + root.after(1000, update_map, canvas, root, restroom) # Aggiorna dopo 500ms +# ---- main ----- + +pattern = r"p=(-?\d+),(-?\d+)\s+v=(-?\d+),(-?\d+)" + +robot_list = [] + +with open(puzzle["filename"], "r") as file: + + for line in file: + match = re.match(pattern, line.strip()) + if match: + x, y, vx, vy = map(int, match.groups()) + robot_list.append((x, y, vx, vy)) + +restroom = Room(puzzle["width"], puzzle["height"]) + +for robot in robot_list: + x,y,vx,vy = robot + restroom.add_robot(x,y,vx,vy) + + + +root = tk.Tk() +root.title("Restroom") + +new_map = restroom.get_map() +canvas = tk.Canvas(root,width = puzzle["width"]*9, height = puzzle["height"]*9, bg="black" ) +canvas.pack() + + +# start form... +restroom.time_step(7000) + +update_map(canvas, root, restroom) + +root.mainloop() + +ret1 = restroom.safety_factor() + +print (f"The solution of for part 1 is: {ret1}") diff --git a/solutions/alv67/day14/input.txt b/solutions/alv67/day14/input.txt new file mode 100644 index 0000000..d887237 --- /dev/null +++ b/solutions/alv67/day14/input.txt @@ -0,0 +1,500 @@ +p=67,43 v=80,86 +p=47,24 v=-9,-96 +p=6,38 v=10,81 +p=73,92 v=36,-93 +p=74,10 v=-35,19 +p=57,59 v=-5,71 +p=21,10 v=48,80 +p=65,64 v=81,-36 +p=79,65 v=-2,18 +p=78,87 v=29,-98 +p=97,66 v=-90,86 +p=18,59 v=72,-90 +p=14,32 v=24,-78 +p=12,63 v=-5,4 +p=69,18 v=52,59 +p=52,79 v=22,18 +p=62,72 v=-41,-29 +p=27,12 v=23,-14 +p=33,51 v=-92,22 +p=5,9 v=-21,-49 +p=37,69 v=-70,18 +p=30,77 v=15,78 +p=87,13 v=-86,-68 +p=30,35 v=-44,-39 +p=18,80 v=-54,61 +p=93,49 v=89,-69 +p=33,24 v=86,12 +p=48,62 v=-53,8 +p=55,95 v=-23,41 +p=53,58 v=38,-77 +p=4,11 v=2,19 +p=20,34 v=-14,42 +p=38,82 v=22,61 +p=3,100 v=96,-59 +p=90,21 v=36,46 +p=60,46 v=-65,-5 +p=64,83 v=18,74 +p=54,22 v=-1,34 +p=1,50 v=-3,-21 +p=30,64 v=-46,-12 +p=71,95 v=5,-11 +p=36,31 v=-60,-77 +p=75,68 v=-53,-81 +p=36,35 v=-22,-37 +p=85,68 v=-11,-94 +p=42,48 v=-88,61 +p=50,96 v=-1,-84 +p=58,28 v=99,16 +p=39,39 v=-30,94 +p=44,90 v=-16,92 +p=35,95 v=-53,40 +p=28,85 v=32,-37 +p=82,57 v=-81,-4 +p=62,68 v=36,60 +p=78,83 v=49,-99 +p=42,86 v=84,-11 +p=6,2 v=79,49 +p=16,67 v=-76,90 +p=40,77 v=31,-33 +p=12,48 v=-4,-51 +p=55,26 v=-39,98 +p=17,83 v=14,70 +p=46,57 v=-86,-47 +p=55,51 v=92,-22 +p=49,89 v=-86,27 +p=10,8 v=57,6 +p=91,79 v=11,-25 +p=67,102 v=91,6 +p=75,41 v=52,-78 +p=22,89 v=9,6 +p=47,88 v=7,19 +p=72,93 v=-52,-52 +p=30,16 v=79,-62 +p=80,25 v=-72,50 +p=30,54 v=-38,86 +p=69,14 v=-89,-83 +p=61,99 v=38,64 +p=98,74 v=89,-50 +p=88,17 v=96,-44 +p=36,80 v=68,-36 +p=4,37 v=-5,63 +p=35,22 v=86,-70 +p=92,74 v=-70,-39 +p=63,59 v=52,-31 +p=85,99 v=-2,15 +p=75,64 v=-18,69 +p=89,42 v=-47,25 +p=19,90 v=19,13 +p=4,9 v=17,20 +p=69,87 v=68,70 +p=11,14 v=48,-1 +p=61,97 v=-56,62 +p=53,51 v=-78,76 +p=42,95 v=-10,6 +p=55,17 v=-71,7 +p=27,15 v=-78,58 +p=22,25 v=-37,-23 +p=6,48 v=-99,8 +p=3,5 v=-75,-84 +p=30,99 v=15,40 +p=96,53 v=-67,17 +p=20,36 v=-61,-82 +p=53,13 v=69,-6 +p=86,8 v=20,-62 +p=37,49 v=-7,-91 +p=46,86 v=7,-68 +p=33,71 v=8,-25 +p=83,50 v=4,-13 +p=57,89 v=-76,20 +p=46,27 v=-63,-27 +p=32,18 v=-45,-87 +p=92,57 v=-13,-55 +p=45,19 v=23,-17 +p=5,15 v=-53,-14 +p=7,39 v=81,-80 +p=90,51 v=42,64 +p=20,4 v=-45,23 +p=76,29 v=51,-47 +p=75,83 v=59,-42 +p=6,65 v=57,-51 +p=51,73 v=85,-81 +p=86,66 v=92,66 +p=74,95 v=90,49 +p=24,102 v=82,54 +p=62,33 v=80,6 +p=69,60 v=-34,-30 +p=22,84 v=-61,18 +p=89,45 v=50,81 +p=2,3 v=34,78 +p=34,44 v=96,-34 +p=82,11 v=-81,84 +p=69,57 v=83,-34 +p=37,44 v=47,77 +p=48,75 v=-71,48 +p=62,30 v=-56,55 +p=0,61 v=-36,35 +p=2,36 v=-59,59 +p=83,80 v=50,9 +p=2,15 v=-45,-96 +p=87,92 v=-27,40 +p=23,38 v=1,64 +p=18,14 v=82,19 +p=32,30 v=64,29 +p=25,61 v=-7,-90 +p=45,16 v=66,82 +p=78,62 v=-42,-13 +p=61,4 v=58,-45 +p=33,49 v=-49,-2 +p=58,96 v=75,71 +p=7,69 v=16,88 +p=98,53 v=26,-99 +p=13,63 v=49,73 +p=66,64 v=44,-4 +p=56,24 v=-32,33 +p=31,56 v=67,85 +p=59,86 v=-41,74 +p=43,74 v=52,4 +p=56,84 v=-72,-21 +p=22,67 v=70,35 +p=44,65 v=-24,-17 +p=34,55 v=35,38 +p=100,101 v=26,49 +p=22,17 v=74,70 +p=82,23 v=21,-65 +p=5,40 v=9,-6 +p=11,22 v=-95,37 +p=8,9 v=80,-36 +p=3,40 v=5,-30 +p=60,83 v=76,87 +p=72,5 v=-34,-88 +p=3,13 v=-44,97 +p=50,62 v=-71,-60 +p=17,5 v=-53,58 +p=44,0 v=-47,35 +p=69,18 v=92,-32 +p=20,98 v=88,41 +p=59,1 v=-25,-92 +p=97,22 v=49,13 +p=14,81 v=-6,82 +p=76,97 v=-80,-89 +p=63,21 v=-94,12 +p=1,67 v=47,56 +p=10,52 v=-77,-50 +p=36,89 v=-86,-89 +p=65,11 v=29,-28 +p=95,93 v=-12,-84 +p=50,95 v=-71,75 +p=25,22 v=55,50 +p=26,28 v=55,89 +p=90,36 v=-74,89 +p=8,19 v=50,88 +p=44,48 v=-23,8 +p=100,70 v=49,39 +p=51,7 v=22,-19 +p=56,51 v=92,34 +p=64,93 v=-18,-47 +p=42,40 v=38,-18 +p=3,22 v=-14,7 +p=21,62 v=-34,-87 +p=44,81 v=-48,69 +p=54,86 v=76,2 +p=94,0 v=-80,88 +p=64,64 v=76,43 +p=0,10 v=-5,-88 +p=100,7 v=64,-28 +p=40,79 v=-8,-33 +p=35,41 v=-54,21 +p=64,43 v=38,96 +p=21,14 v=18,-23 +p=50,88 v=22,23 +p=63,94 v=76,-97 +p=72,36 v=84,17 +p=71,29 v=-70,-8 +p=57,63 v=23,17 +p=33,58 v=-22,-24 +p=75,16 v=-18,50 +p=80,49 v=29,77 +p=40,63 v=85,-99 +p=38,88 v=8,-58 +p=29,70 v=-37,52 +p=80,60 v=20,-51 +p=40,86 v=-86,-68 +p=2,69 v=-36,-34 +p=4,38 v=93,51 +p=12,28 v=27,-94 +p=36,70 v=92,95 +p=94,90 v=59,-59 +p=60,16 v=-41,-28 +p=75,89 v=28,48 +p=1,27 v=4,-40 +p=45,9 v=45,51 +p=34,10 v=17,84 +p=84,58 v=-20,-16 +p=22,92 v=49,36 +p=6,51 v=-43,-65 +p=100,41 v=-28,47 +p=52,87 v=-85,55 +p=44,38 v=98,4 +p=44,41 v=15,51 +p=47,92 v=76,28 +p=10,69 v=-37,48 +p=50,64 v=23,86 +p=22,92 v=6,-51 +p=32,17 v=-77,-57 +p=59,97 v=-1,53 +p=88,24 v=-26,-83 +p=25,86 v=32,2 +p=88,79 v=46,98 +p=58,41 v=61,-78 +p=82,45 v=-90,55 +p=6,78 v=88,65 +p=62,82 v=-77,-61 +p=94,65 v=-76,-76 +p=90,12 v=3,59 +p=53,8 v=22,71 +p=66,102 v=-2,-24 +p=86,9 v=13,84 +p=32,102 v=62,36 +p=74,50 v=36,30 +p=75,7 v=5,-79 +p=77,0 v=58,83 +p=2,62 v=18,-90 +p=12,80 v=48,31 +p=67,22 v=-64,37 +p=7,52 v=49,49 +p=46,12 v=-79,-11 +p=53,49 v=38,-91 +p=43,82 v=-55,-46 +p=43,42 v=89,35 +p=20,17 v=33,45 +p=30,48 v=-7,64 +p=72,19 v=4,50 +p=64,62 v=-2,30 +p=36,93 v=8,23 +p=41,46 v=-62,-56 +p=15,52 v=5,-17 +p=61,8 v=-89,10 +p=7,93 v=80,-93 +p=65,97 v=-95,19 +p=30,92 v=68,-66 +p=72,97 v=67,23 +p=74,102 v=-42,-24 +p=38,0 v=85,2 +p=21,12 v=71,-2 +p=64,85 v=55,-83 +p=71,70 v=-10,39 +p=30,72 v=15,75 +p=66,85 v=-2,-76 +p=98,78 v=-12,69 +p=8,102 v=87,36 +p=100,7 v=-58,-23 +p=35,1 v=-85,88 +p=31,100 v=-42,-2 +p=39,0 v=71,83 +p=4,22 v=-20,-90 +p=68,53 v=-31,8 +p=26,21 v=17,-36 +p=75,100 v=-34,-84 +p=21,50 v=-4,10 +p=55,26 v=64,74 +p=96,11 v=78,56 +p=61,55 v=-25,38 +p=14,75 v=-76,78 +p=27,41 v=-56,-99 +p=44,79 v=77,-76 +p=65,96 v=-2,66 +p=97,51 v=65,-9 +p=98,41 v=-98,81 +p=52,5 v=-31,-88 +p=83,6 v=-59,-70 +p=53,75 v=-17,-12 +p=81,97 v=81,-89 +p=40,2 v=34,-66 +p=86,42 v=74,47 +p=16,12 v=-28,-44 +p=44,40 v=-6,74 +p=100,11 v=-44,97 +p=66,95 v=98,74 +p=59,2 v=-87,24 +p=89,36 v=-93,-90 +p=30,62 v=-46,-34 +p=19,39 v=-99,-46 +p=15,95 v=-63,-17 +p=54,25 v=-56,76 +p=13,98 v=-78,-11 +p=28,100 v=86,19 +p=83,45 v=51,-13 +p=91,53 v=-35,-69 +p=32,1 v=-98,-48 +p=66,83 v=66,94 +p=3,12 v=-72,-66 +p=87,13 v=58,-75 +p=0,35 v=-83,-1 +p=31,74 v=86,53 +p=40,66 v=93,-21 +p=59,52 v=-71,95 +p=19,70 v=79,-55 +p=65,85 v=-93,-74 +p=98,68 v=74,-50 +p=79,50 v=-82,-5 +p=25,45 v=-87,40 +p=4,97 v=-52,-88 +p=47,28 v=63,-11 +p=5,41 v=57,55 +p=56,84 v=-87,74 +p=77,15 v=51,84 +p=2,45 v=-45,-99 +p=31,38 v=78,68 +p=88,57 v=59,48 +p=39,22 v=-70,16 +p=79,4 v=-81,84 +p=28,66 v=10,39 +p=10,28 v=-53,-79 +p=22,20 v=87,50 +p=35,67 v=43,-25 +p=32,59 v=-38,-17 +p=83,2 v=-80,79 +p=47,47 v=-75,5 +p=17,59 v=74,-49 +p=6,50 v=73,-61 +p=76,62 v=-89,1 +p=33,14 v=47,-23 +p=18,54 v=17,34 +p=19,72 v=-42,-22 +p=89,58 v=-97,86 +p=87,73 v=-74,-20 +p=98,30 v=-90,-1 +p=53,72 v=-1,-93 +p=0,23 v=10,-96 +p=39,0 v=59,34 +p=90,68 v=-69,31 +p=10,29 v=97,52 +p=98,30 v=-66,34 +p=58,98 v=84,40 +p=82,33 v=59,72 +p=64,79 v=21,14 +p=26,30 v=72,59 +p=68,83 v=-43,58 +p=27,59 v=-15,-13 +p=86,96 v=-66,62 +p=49,100 v=38,28 +p=49,57 v=-24,47 +p=60,101 v=-25,35 +p=1,97 v=-59,36 +p=20,101 v=19,-7 +p=31,87 v=24,36 +p=84,77 v=-28,-46 +p=10,3 v=-5,75 +p=77,52 v=37,-81 +p=24,0 v=92,-61 +p=89,43 v=97,-95 +p=48,9 v=-40,71 +p=0,45 v=95,-73 +p=8,40 v=-13,42 +p=94,7 v=59,-6 +p=93,33 v=3,72 +p=0,68 v=-45,-65 +p=76,41 v=-11,-71 +p=86,85 v=-96,32 +p=76,41 v=9,55 +p=67,79 v=58,20 +p=55,56 v=82,37 +p=54,45 v=-56,64 +p=4,24 v=-44,16 +p=47,52 v=-94,64 +p=49,71 v=55,-7 +p=65,28 v=-2,-74 +p=66,56 v=29,-26 +p=81,9 v=-65,-57 +p=26,15 v=-92,67 +p=62,95 v=4,61 +p=46,0 v=67,-91 +p=20,11 v=-53,-32 +p=89,65 v=-27,69 +p=94,27 v=53,93 +p=33,2 v=-30,-84 +p=73,102 v=83,80 +p=32,80 v=-70,-94 +p=56,81 v=63,-72 +p=44,57 v=-56,-94 +p=92,62 v=-51,1 +p=77,71 v=-18,-51 +p=25,48 v=41,12 +p=74,16 v=-42,-61 +p=69,10 v=20,-52 +p=100,33 v=18,-1 +p=45,46 v=55,-1 +p=1,58 v=21,-74 +p=69,61 v=68,86 +p=25,102 v=1,79 +p=17,28 v=25,-27 +p=43,10 v=-30,-79 +p=10,91 v=-54,13 +p=41,75 v=39,-38 +p=68,88 v=-49,96 +p=83,38 v=98,-61 +p=0,64 v=-19,32 +p=100,36 v=81,-82 +p=21,98 v=71,-50 +p=98,41 v=-91,13 +p=33,31 v=3,30 +p=53,89 v=-40,40 +p=86,26 v=-19,-83 +p=31,32 v=86,12 +p=97,99 v=-50,-15 +p=73,44 v=-65,98 +p=4,85 v=96,-80 +p=7,15 v=-91,-27 +p=100,7 v=64,7 +p=50,25 v=84,-22 +p=27,1 v=-8,-93 +p=93,38 v=69,-37 +p=32,65 v=17,-89 +p=61,86 v=22,-93 +p=27,48 v=71,-13 +p=60,22 v=-29,-61 +p=42,53 v=-70,77 +p=47,60 v=38,-42 +p=38,61 v=32,-39 +p=58,72 v=-9,95 +p=53,85 v=22,-63 +p=71,94 v=83,-54 +p=67,18 v=-80,-79 +p=58,53 v=53,-56 +p=19,33 v=9,82 +p=90,40 v=4,4 +p=95,101 v=11,-11 +p=46,21 v=-36,46 +p=81,43 v=-31,14 +p=38,83 v=-80,13 +p=20,45 v=-68,-5 +p=35,70 v=-53,70 +p=91,35 v=65,90 +p=99,76 v=-59,-7 +p=87,39 v=-66,55 +p=64,58 v=59,73 +p=46,100 v=93,49 +p=19,36 v=33,-61 +p=39,101 v=-62,6 +p=50,17 v=-68,36 +p=35,78 v=-17,99 +p=23,3 v=29,53 +p=49,43 v=-61,-79 +p=97,65 v=-74,86 +p=47,14 v=-64,67 +p=43,84 v=47,33 +p=30,87 v=-92,-28 +p=4,81 v=-72,65 +p=93,86 v=97,87 +p=41,64 v=70,-81 +p=6,13 v=3,-19 +p=19,29 v=80,-6 +p=39,49 v=27,70 +p=15,32 v=66,48 +p=62,40 v=-25,-9 +p=90,29 v=-4,76 +p=55,4 v=-1,93 +p=50,85 v=35,88 +p=5,84 v=48,87 +p=58,9 v=92,-15 diff --git a/solutions/alv67/day14/test.txt b/solutions/alv67/day14/test.txt new file mode 100644 index 0000000..2455da4 --- /dev/null +++ b/solutions/alv67/day14/test.txt @@ -0,0 +1,12 @@ +p=0,4 v=3,-3 +p=6,3 v=-1,-3 +p=10,3 v=-1,2 +p=2,0 v=2,-1 +p=0,0 v=1,3 +p=3,0 v=-2,-2 +p=7,6 v=-1,-3 +p=3,0 v=-1,-2 +p=9,3 v=2,3 +p=7,3 v=-1,2 +p=2,4 v=2,-3 +p=9,5 v=-3,-3 diff --git a/solutions/alv67/day15/day15.ipynb b/solutions/alv67/day15/day15.ipynb new file mode 100644 index 0000000..30199ad --- /dev/null +++ b/solutions/alv67/day15/day15.ipynb @@ -0,0 +1,340 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 15: Warehouse Woes ---\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 1 is: 1509074\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "# from icecream import ic\n", + "# import re\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "#filename = \"test.txt\" # decomment to use test\n", + "#filename = \"test_mini.txt\" # decomment to use test\n", + "\n", + "def parse_file(file_path):\n", + " grid = { \"size\": (0,0), \"walls\": [], \"boxes\" : [], \"robot\" : None}\n", + " movements = [] # \n", + "\n", + " with open(file_path, 'r') as file:\n", + " #\n", + " content = file.read()\n", + " blocks = [block.strip() for block in content.split(\"\\n\\n\") if block.strip()]\n", + "\n", + " # get grid \n", + "\n", + " gridmap = [list(c) for c in blocks[0].splitlines()]\n", + " grid[\"size\"] = (len(gridmap[0]), len(gridmap))\n", + "\n", + " for y, row in enumerate(gridmap):\n", + " for x, obj in enumerate(row):\n", + " if obj == \"@\":\n", + " grid[\"robot\"] = (x,y)\n", + " elif obj == \"#\":\n", + " grid[\"walls\"].append((x,y))\n", + " elif obj == \"O\":\n", + " grid[\"boxes\"].append((x,y))\n", + " else:\n", + " pass\n", + " # get movements\n", + " for line in blocks[1].splitlines():\n", + " movements.extend(list(line.strip()))\n", + " \n", + " return grid, movements\n", + "\n", + "class FieldMap:\n", + "\n", + " def __init__(self, grid):\n", + " self.walls = grid[\"walls\"]\n", + " self.boxes = grid[\"boxes\"]\n", + " self.robot_pos = grid[\"robot\"]\n", + " self.size = grid[\"size\"]\n", + "\n", + " def __str__(self):\n", + " retstr = \"\"\n", + " for y in range(self.size[1]):\n", + " for x in range(self.size[0]):\n", + " if (x,y) in self.walls:\n", + " retstr += \"#\"\n", + " elif (x,y) in self.boxes:\n", + " retstr += \"O\"\n", + " elif (x,y) == self.robot_pos:\n", + " retstr += \"@\"\n", + " else:\n", + " retstr += \".\"\n", + " retstr += \"\\n\"\n", + " return retstr\n", + "\n", + " def _new_pos(self, pos, dir):\n", + " if dir == \"<\":\n", + " return (pos[0]-1, pos[1])\n", + " if dir == \">\":\n", + " return (pos[0]+1, pos[1])\n", + " if dir == \"^\":\n", + " return (pos[0], pos[1]-1)\n", + " if dir == \"v\":\n", + " return (pos[0], pos[1]+1)\n", + " return None\n", + " \n", + " def move_object(self, position, direction) -> bool:\n", + " if position[0] < 0 or position[0] >= self.size[0]:\n", + " return False\n", + " if position[1] < 0 or position[1] >= self.size[1]:\n", + " return False\n", + " if position in self.walls:\n", + " return False\n", + " if position in self.boxes:\n", + " new_pos = self._new_pos(position, direction)\n", + " if self.move_object(new_pos , direction):\n", + " self.boxes.remove(position)\n", + " self.boxes.append(new_pos)\n", + " return True\n", + " return False \n", + " if position == self.robot_pos: \n", + " new_pos = self._new_pos(position, direction)\n", + " if self.move_object(new_pos , direction):\n", + " self.robot_pos = new_pos\n", + " return True\n", + " return False \n", + " return True \n", + "\n", + "# ---- main ----\n", + "\n", + "grid, movements = parse_file(filename)\n", + "\n", + "fieldmap = FieldMap(grid)\n", + "\n", + "#print(fieldmap)\n", + "\n", + "for mv in movements:\n", + " fieldmap.move_object(fieldmap.robot_pos, mv)\n", + "# print(f\"Move {mv}:\")\n", + " \n", + "#print(fieldmap) \n", + "\n", + "ret1 = sum([100 * v[1] + v[0] for v in fieldmap.boxes])\n", + "\n", + "print (f\"The solution of for part 1 is: {ret1}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 2 is: 1521453\n" + ] + } + ], + "source": [ + "# --- Part two ---\n", + "# Uses code of Part One\n", + "\n", + "\n", + "# from icecream import ic\n", + "# import re\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "#filename = \"test.txt\" # decomment to use test\n", + "#filename = \"test2_mini.txt\" # decomment to use test\n", + "\n", + "def parse_file(file_path):\n", + " grid = { \"size\": (0,0), \"walls\": [], \"boxes\" : {}, \"robot\" : None}\n", + " movements = [] # \n", + "\n", + " with open(file_path, 'r') as file:\n", + " #\n", + " content = file.read()\n", + " blocks = [block.strip() for block in content.split(\"\\n\\n\") if block.strip()]\n", + "\n", + " # get grid \n", + "\n", + " gridmap = [list(c) for c in blocks[0].splitlines()]\n", + " grid[\"size\"] = (2 * len(gridmap[0]), len(gridmap))\n", + "\n", + " for y, row in enumerate(gridmap):\n", + " for x, obj in enumerate(row):\n", + " if obj == \"@\":\n", + " grid[\"robot\"] = (x*2,y)\n", + " elif obj == \"#\":\n", + " grid[\"walls\"].append((x*2,y))\n", + " grid[\"walls\"].append((x*2+1,y))\n", + " elif obj == \"O\":\n", + " grid[\"boxes\"][(x*2,y)] = \"[\"\n", + " grid[\"boxes\"][(x*2+1,y)] = \"]\"\n", + " else:\n", + " pass\n", + " # get movements\n", + " for line in blocks[1].splitlines():\n", + " movements.extend(list(line.strip()))\n", + " \n", + " return grid, movements\n", + "\n", + "class FieldMap:\n", + "\n", + " def __init__(self, grid):\n", + " self.walls = grid[\"walls\"]\n", + " self.boxes = grid[\"boxes\"]\n", + " self.robot_pos = grid[\"robot\"]\n", + " self.size = grid[\"size\"]\n", + "\n", + " def __str__(self):\n", + " retstr = \"\"\n", + " for y in range(self.size[1]):\n", + " for x in range(self.size[0]):\n", + " if (x,y) in self.walls:\n", + " retstr += \"#\"\n", + " elif (x,y) in self.boxes:\n", + " retstr += self.boxes[(x,y)]\n", + " elif (x,y) == self.robot_pos:\n", + " retstr += \"@\"\n", + " else:\n", + " retstr += \".\"\n", + " retstr += \"\\n\"\n", + " return retstr\n", + "\n", + " def _new_pos(self, pos, dir):\n", + " if dir == \"<\":\n", + " return (pos[0]-1, pos[1])\n", + " if dir == \">\":\n", + " return (pos[0]+1, pos[1])\n", + " if dir == \"^\":\n", + " return (pos[0], pos[1]-1)\n", + " if dir == \"v\":\n", + " return (pos[0], pos[1]+1)\n", + " return None\n", + "\n", + " def _can_move(self, position, direction):\n", + " if position[0] < 0 or position[0] >= self.size[0]:\n", + " return False\n", + " if position[1] < 0 or position[1] >= self.size[1]:\n", + " return False\n", + " if position in self.walls:\n", + " return False\n", + " if position in self.boxes:\n", + " if self.boxes[position] == \"[\":\n", + " pos_l = position\n", + " pos_r = self._new_pos(position, \">\")\n", + " else:\n", + " pos_r = position\n", + " pos_l = self._new_pos(position, \"<\")\n", + " if direction == \"<\":\n", + " new_pos = self._new_pos(pos_l, direction)\n", + " if self._can_move(new_pos, direction):\n", + " return True\n", + " elif direction == \">\":\n", + " new_pos = self._new_pos(pos_r, direction)\n", + " if self._can_move(new_pos, direction):\n", + " return True\n", + " else: # direction \"^\" or \"v\" \n", + " new_pos_l = self._new_pos(pos_l, direction)\n", + " new_pos_r = self._new_pos(pos_r, direction)\n", + " if self._can_move(new_pos_l , direction) and self._can_move(new_pos_r , direction):\n", + " return True\n", + " return False \n", + " if position == self.robot_pos: \n", + " new_pos = self._new_pos(position, direction)\n", + " if self._can_move(new_pos , direction):\n", + " return True\n", + " return False \n", + " return True \n", + " \n", + " def move_object(self, position, direction) -> bool:\n", + " if position in self.boxes:\n", + " if self._can_move(position, direction):\n", + " if self.boxes[position] == \"[\":\n", + " pos_l = position\n", + " pos_r = self._new_pos(position, \">\")\n", + " else:\n", + " pos_r = position\n", + " pos_l = self._new_pos(position, \"<\")\n", + " new_pos_l = self._new_pos(pos_l, direction)\n", + " new_pos_r = self._new_pos(pos_r, direction)\n", + " if direction == \"<\":\n", + " self.move_object(new_pos_l, direction)\n", + " elif direction == \">\":\n", + " self.move_object(new_pos_r, direction)\n", + " else:\n", + " self.move_object(new_pos_l, direction)\n", + " self.move_object(new_pos_r, direction)\n", + " del self.boxes[pos_l]\n", + " del self.boxes[pos_r]\n", + " self.boxes[new_pos_l] = \"[\"\n", + " self.boxes[new_pos_r] = \"]\"\n", + " return True\n", + " return False\n", + " if position == self.robot_pos: \n", + " if self._can_move(position, direction):\n", + " new_pos = self._new_pos(position, direction)\n", + " if self.move_object(new_pos, direction):\n", + " self.robot_pos = new_pos\n", + " return True\n", + " return False \n", + " return True \n", + "\n", + "# ---- main ----\n", + "\n", + "grid, movements = parse_file(filename)\n", + "\n", + "fieldmap = FieldMap(grid)\n", + "\n", + "# print(fieldmap)\n", + "\n", + "for mv in movements:\n", + " fieldmap.move_object(fieldmap.robot_pos, mv)\n", + " #print(f\"Move {mv}:\")\n", + "\n", + "# print(fieldmap) \n", + "\n", + "ret2 = sum([100 * k[1] + k[0] for k, v in fieldmap.boxes.items() if v == \"[\"])\n", + "\n", + "print (f\"The solution of for part 2 is: {ret2}\")\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day15/input.txt b/solutions/alv67/day15/input.txt new file mode 100644 index 0000000..bb931b3 --- /dev/null +++ b/solutions/alv67/day15/input.txt @@ -0,0 +1,71 @@ +################################################## +#.#...........O.O....#..O.#O.O#.O....OOO.O...O...# +#.#O......O...O..#...........#...#.....#...##....# +#O.OO..O.OO.O..OO.....O...#...O...#O.O.#..O...##.# +#...OOO..#..OO.....O.O.#OO#.OO#....O.......#..OO## +#.O......OO.O.O...OOO.O#......##..O.O..O......O### +##.......#.O.OO..O.....O....#..........O..O.O...O# +#.....OO..##.O.#...#....#......OO.....O.O...O....# +#OO.OOO...#..#O.....O#O...O.#...........O..#..##O# +#OO##......O.O.#OO.O.OO..#O.O.O.O.O.O.....O.OOO.O# +#O.....#OOO...O.O...#.#O....#......OOO...O.OO....# +#O.O...O.........#..##..O..#.O...O...O..O.OO..#.O# +#.......O..O#....OO.O.O#...O..O.#O..O.O#.....OO..# +#OO.O#O...O#..#...#O.#....O#O..#.O..O#...O..##..O# +#O......O.#..O.......O.O.OO..O#.......O..O#..#..O# +#....O...OO...O.O..##....O.#..O.O..O..O....OOOO..# +#.....O.O.O..O.O.O.O.O.OO....O..OO..O.O...O.O#..O# +#O......OO.O......#O.O.OO#......O....OO..O...O..O# +#O......OO..O....O...O.....OOO.O....OO.O..O#...OO# +#..OOOOOO.O..OO..O...O.....#......OO.#.O...#O.O.O# +#...O..#O..O.OO.......O...##OO.#.........#O.#...O# +#...OO.#O..OO....##....#...OO..#...O.O..O...O..OO# +##...O.#..#O.#OO......O..OO.O#..O.....O.#..O.OOOO# +##.....#......O.OO#O.O..O....O..O.OOO.O..O...O.#O# +#........O.O..OO..O.....@....#..O...OOOO#.O......# +#O....O....O...OO.OOO...O.OO.....OO#..O......O.O.# +#...O..O...O.OOOO.....#...O.O....O##O.....O.#...O# +#...O.....O...#.......O.OO..O..#.#OO.OO........#.# +##.O........#.......#O#.............O...O#..#.O#.# +#O.....O.OOOO.....O.O...OO.O...O.O...OO..O...O.O.# +#...........O...OOOOOO....O.O.#.OO...O.O..OO.....# +#..O##.......OO.OO.##..#..O...#.O..O#O...O.O#..O.# +#...OO...OO.O.......#.....OOO.O..O..O.....O...O..# +#..OO.......OO.....#......OO.O..O..#....OO....O..# +#...OO..OO...O.OO.O#.O...#.O..........OOO...OO..## +#..#O..O#....O....#....O.#...OO.O.#...#.........O# +#O.......O..OO...O.O.O...OO#O.#..O.#O..#..O.#O..O# +#..O..O...#OO...O..O.#OO.O.O...O.......##..O#..#.# +#.O..#....O..O.O..O..O.O..#....O..#...O.OO#.O....# +##OOO.O.O.................O.O..##OO.O.O.O.OO.O.O.# +#..O..................OO...O....OOO#...O....O.#..# +#..#.O#..#...OO....#....OO......#......O..OO..O.O# +#.O..OO...OO.#.OO..OOOOO#.O.OO...O.O.#...O..#.OO.# +#...O..#O#...#..............OO.#.#.....OO.......O# +#.O#.....O#..OO.#..O......#..#O.O#.O.OO........O.# +#OO.O#...O#.O......OO......O...........##.O..#...# +#..O#...O.#...O.O...O...OO.O#OOO..OO#..O..OOOO.O.# +#...O.O#..OO........O#.OO.....#O.O.O#......#O.O#.# +#........O....O....O#..#.....O..O..OO#.OOO....O..# +################################################## + +^v<<><><<^><><>vv><^^v><>v><^^^vvv^^><<^v^>^^<>>v>v<^<^^>v^v>^vv^v><>>vv>^^><>^>v<^^><>^^^^<<v>^>v>v^v>^<>^v^vv^<^^<<<<<^v<>>v^vv^^>^^^^><<<^^^v<^^v>^^vv<>><<>v>v<^^v>v^^<^>^^<<>^>^<<<^vv^>>v<><>^^><^>>^^^vv^v<>v^v<^v^vv<^<^<<>v<^<<><^<>><^<>^v^><<^<<^>><>>><^vv<>vv<^>v><>vvvvv<><>>v>>^vvv^v<><<^><>^<<>>vv<<>>>>v<<>v<>vv>^v>>^v^<^<<>v<>^>^^>^vv>v^^>^vvv<^^vv^^^>vv<^^>vv<^^<<>v^vvv^<^><^<>^>^^^<<>^vv<<><>^^<><^vv>^^^>^<<^^<><<<^^v><>^<^v>>^>^^v<>^v^<^v^^v>>v<^>>>>>vv^v>^>>v^><^v>^v<^^<><^v>>^>>>^v^^<<^^^>v>v^^v^>>^^<^vv<^>vv^<^>v<>v<<<<^v^^<>^^>^>vv<>^v>^v<<>^><^v<<>>^vv<>v>>^>>^>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^<>>v^v^>>>v<>>><^v><<>vv>v>v^^vv>v^>^v<<><<<>>^^><^>>>v^^vv>>v><^>v>v^^v<<^>>^><>v^v<<<>v<^<>^<<<^v>^><^>^^v^^><>vv>v^^<^v<^><>^vv>v^^v>>^v^<>>>vv>^>^>^v<<>^vv<<>v^^^v>><<<>><>^^v<<v^^^^^<><^<>>^^<>^<>v^>><^v^>^<^v^vv>v>>vv>><^v><<^<^^^^v<>vv^>^><^>^><<^><>^^v^^<><<<<>vv^v>^^><>^v^^vv^^>^v^>>^vv>^^vvv^<^^^<>v<^^vvv>>v^vvvv<><>^v<>><>v>^<^v<^v^><<^<>^>>>v<>vv>>^^vv<>>>><<<><>><^^^v<<^><^<><<<v>><>v<>>><^<>^>>v^vv^vv<>^v^v>^<>^><>v>^^<< diff --git a/solutions/alv67/day15/test.txt b/solutions/alv67/day15/test.txt new file mode 100644 index 0000000..84cf1fb --- /dev/null +++ b/solutions/alv67/day15/test.txt @@ -0,0 +1,21 @@ +########## +#..O..O.O# +#......O.# +#.OO..O.O# +#..O@..O.# +#O#..O...# +#O..O..O.# +#.OO.O.OO# +#....O...# +########## + +^v>^vv^v>v<>v^v<<><>>v^v^>^<<<><^ +vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<^<^^>>>^<>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^v^^<^^vv< +<>^^^^>>>v^<>vvv^>^^^vv^^>v<^^^^v<>^>vvvv><>>v^<<^^^^^ +^><^><>>><>^^<<^^v>>><^^>v>>>^v><>^v><<<>vvvv>^<><<>^>< +^>><>^v<><^vvv<^^<><^v<<<><<<^^<^>>^<<<^>>^v^>>^v>vv>^<<^v<>><<><<>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^ +<><^^>^^^<>^vv<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<> +^^>vv<^v^v^<>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<>< +v^^>>><<^^<>>^v^v^<<>^<^v^v><^<<<><<^vv>>v>v^<<^ diff --git a/solutions/alv67/day15/test2_mini.txt b/solutions/alv67/day15/test2_mini.txt new file mode 100644 index 0000000..6ee6098 --- /dev/null +++ b/solutions/alv67/day15/test2_mini.txt @@ -0,0 +1,9 @@ +####### +#...#.# +#.....# +#..OO@# +#..O..# +#.....# +####### + +>>vv>v<< diff --git a/solutions/alv67/day16/day16.ipynb b/solutions/alv67/day16/day16.ipynb new file mode 100644 index 0000000..547ab2d --- /dev/null +++ b/solutions/alv67/day16/day16.ipynb @@ -0,0 +1,463 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 16: Reindeer Maze ---\n" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution of for part 1 is: 111480\n", + "The solution of for part 2 is: 527\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "from icecream import ic\n", + "# import re\n", + "import time\n", + "from IPython.display import clear_output\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "#filename = \"test1.txt\" # decomment to use test\n", + "#filename = \"test2.txt\" # decomment to use test\n", + "\n", + "COST_STEP = 1\n", + "COST_ROTATE = 1000\n", + "DIR = [\">\", \"v\", \"<\", \"^\"]\n", + "MOVE = { \">\": (1, 0), \"v\": (0, 1), \"<\": (-1, 0), \"^\": (0, -1) }\n", + "\n", + "class Maze:\n", + "\n", + " def __init__(self, filename = \"\"):\n", + "\n", + " self.walls = []\n", + " self.paths = []\n", + " self.start = None\n", + " self.end = None\n", + " self.size = (0,0)\n", + " self.load_maze(filename)\n", + " self.cost_map = {}\n", + " self.exit_path = {}\n", + " self.alltiles = set()\n", + "\n", + " def load_maze(self, filename):\n", + "\n", + " with open(filename, 'r') as file:\n", + " grid = [list(c) for c in [line.strip() for line in file]]\n", + " self.size = (len(grid[0]), len(grid))\n", + "\n", + " for y, row in enumerate(grid):\n", + " for x, obj in enumerate(row):\n", + " if obj == \"S\":\n", + " self.start = (x,y)\n", + " elif obj == \"E\":\n", + " self.end = (x,y)\n", + " elif obj == \"#\":\n", + " self.walls.append((x,y))\n", + " elif obj == \".\":\n", + " self.paths.append((x,y))\n", + " else:\n", + " pass \n", + "\n", + " def __str__(self):\n", + " retstr = \"\"\n", + " for y in range(self.size[1]):\n", + " for x in range(self.size[0]):\n", + " if (x,y) in self.walls:\n", + " retstr += \"#\"\n", + " elif (x,y) in self.paths:\n", + " retstr += \".\"\n", + " elif (x,y) == self.start:\n", + " retstr += \"S\"\n", + " elif (x,y) == self.end:\n", + " retstr += \"E\"\n", + " else:\n", + " pass\n", + " retstr += \"\\n\"\n", + " return retstr\n", + " \n", + " def _left(self, pos, dir):\n", + " new_dir = DIR[(DIR.index(dir)-1)%len(DIR)]\n", + " return self._forward(pos, new_dir)\n", + "\n", + " def _right(self, pos, dir):\n", + " new_dir = DIR[(DIR.index(dir)+1)%len(DIR)]\n", + " return self._forward(pos, new_dir)\n", + "\n", + " def _forward(self,pos,dir):\n", + " new_pos = (pos[0] + MOVE[dir][0], pos[1] + MOVE[dir][1])\n", + " # print(f\"{new_pos}\")\n", + " if new_pos in self.paths or new_pos == self.end or new_pos == self.start:\n", + " return new_pos, dir\n", + " return []\n", + "\n", + " def _new_path(self, pos, dir):\n", + " retvalue = []\n", + " ret = self._forward(pos, dir)\n", + " # print (f\"fwd: {ret}\")\n", + " if ret : retvalue.append(ret)\n", + " ret = self._left(pos, dir)\n", + " # print (f\"lft: {ret}\")\n", + " if ret : retvalue.append(ret)\n", + " ret = self._right(pos, dir)\n", + " # print (f\"rgt: {ret}\")\n", + " if ret : retvalue.append(ret)\n", + " return retvalue\n", + "\n", + "\n", + " def path_find(self, pos, dir, end = \"E\") -> dict:\n", + " \"\"\"\n", + " Map costs for each position of the maze. \n", + " Keep only minimum costs. Returns the cost present on self.end position.\n", + " \"\"\"\n", + " map_cost = {}\n", + " map_cost[pos] = {\"cost\": 0, \"dir\": dir, \"from\":None}\n", + "\n", + " to_check = [(pos, dir)]\n", + "\n", + " while to_check: \n", + " p ,d = to_check.pop(0)\n", + " if d != map_cost[p][\"dir\"]: continue # cell was reached from another direction\n", + " # print (f\"{p} {d}\")\n", + " for np, nd in self._new_path(p, d):\n", + " nc = map_cost[p][\"cost\"]\n", + " # calculate new cost\n", + " if nd == d: #same direction\n", + " nc += COST_STEP\n", + " else: \n", + " nc += COST_STEP + COST_ROTATE\n", + " c = map_cost.get(np,{\"cost\": None})[\"cost\"]\n", + " if not c or c > nc:\n", + " map_cost[np] = {\"cost\": nc, \"dir\": nd, \"from\":p}\n", + " to_check.append((np, nd))\n", + " # get the exit path\n", + " stp = self.end\n", + " exit_path = {}\n", + " while stp:\n", + " c , d, f = map_cost[stp].values()\n", + " if stp == self.end: d = \"E\"\n", + " if stp == self.start: d = \"S\"\n", + " exit_path[c] = (stp, d)\n", + " stp = f\n", + " \n", + " self.exit_path = {k: v for k, v in sorted(exit_path.items())}\n", + " self.cost_map = map_cost \n", + " return map_cost[self.end][\"cost\"] \n", + "\n", + " def get_alltiles(self):\n", + " \"\"\"\n", + " Get all the tiles for best paths\n", + " \"\"\"\n", + " def _get_ck_values(pos, cost, dir):\n", + " ck = []\n", + " if dir == \"^\":\n", + " np = (pos[0],pos[1]+1)\n", + " if dir == \"v\":\n", + " np = (pos[0],pos[1]-1)\n", + " if dir == \"<\":\n", + " np = (pos[0]+1,pos[1]) \n", + " if dir == \">\":\n", + " np = (pos[0]-1,pos[1])\n", + " ck.append((cost-COST_STEP, dir))\n", + " if dir == \"^\" or dir == \"v\":\n", + " ck.append((cost-COST_STEP-COST_ROTATE, \"<\"))\n", + " ck.append((cost-COST_STEP-COST_ROTATE, \">\"))\n", + " if dir == \"<\" or dir == \">\":\n", + " ck.append((cost-COST_STEP-COST_ROTATE, \"^\"))\n", + " ck.append((cost-COST_STEP-COST_ROTATE, \"v\"))\n", + " return np, ck \n", + " \n", + " tiles= set()\n", + " to_check = []\n", + " ck_data = {}\n", + " p = self.end\n", + " # print(self.cost_map[p])\n", + " c , d, _ = self.cost_map[self.end].values()\n", + " to_check.append(p)\n", + " ck_data[p] = [(c, \"^\"), (c, \">\")]\n", + " while to_check: \n", + " p = to_check.pop(0)\n", + " ck = ck_data[p]\n", + " if p not in self.cost_map: continue\n", + " if p in to_check: continue\n", + " if self.cost_map[p][\"cost\"] not in [v[0] for v in ck]:\n", + " continue\n", + " tiles.add(p)\n", + " # For each possible value in tyle check\n", + " for c, d in ck:\n", + " np, nck = _get_ck_values(p, c, d)\n", + " to_check.append(np)\n", + " ck_data[np] = nck\n", + " self.alltiles = tiles\n", + " return tiles\n", + " \n", + " def print_cost_map(self, cost_map = None):\n", + " if not cost_map: cost_map = self.cost_map\n", + " max_cost = max(c[\"cost\"] for c in cost_map.values()) if cost_map else 0\n", + " cell_w = len(f\"[{max_cost}]\")\n", + " retstr = \"\"\n", + " for y in range(self.size[1]):\n", + " for x in range(self.size[0]):\n", + " if (x,y) in self.walls:\n", + " retstr += cell_w*\"#\"\n", + " elif (x,y) in self.paths:\n", + " retstr += f\"[{cost_map.get((x,y),{\"cost\": ''})[\"cost\"]:^{cell_w-2}}]\"\n", + " elif (x,y) == self.start:\n", + " retstr += f\"[{cost_map.get((x,y),{\"cost\": ''})[\"cost\"]:^{cell_w-2}}]\"\n", + " elif (x,y) == self.end:\n", + " retstr += f\"[{cost_map.get((x,y),{\"cost\": ''})[\"cost\"]:^{cell_w-2}}]\"\n", + " else:\n", + " pass\n", + " retstr += \"\\n\"\n", + " #clear_output()\n", + " print(retstr)\n", + " \n", + " def print_exit_map(self, all=False, char = None, exit_path = None):\n", + " if not exit_path: exit_path = self.exit_path\n", + " retstr = \"\"\n", + " if all == False:\n", + " ex_path = {v[0]: v[1] for v in exit_path.values()}\n", + " for y in range(self.size[1]):\n", + " for x in range(self.size[0]):\n", + " if (x,y) in self.walls:\n", + " retstr += \"#\"\n", + " elif all and (x,y) in self.alltiles:\n", + " retstr += char if char else \"O\"\n", + " elif not all and (x,y) in ex_path:\n", + " retstr += char if char else ex_path[(x,y)] \n", + " else:\n", + " retstr += \" \"\n", + " retstr += \"\\n\"\n", + " clear_output()\n", + " print(retstr)\n", + "\n", + "\n", + "\n", + " \n", + "# ---- main ----\n", + "\n", + "maze = Maze(filename)\n", + "\n", + "# print(maze)\n", + "\n", + "ret1 = maze.path_find(maze.start, \">\")\n", + "print (f\"The solution of for part 1 is: {ret1}\")\n", + "\n", + "map1 = maze.cost_map.copy()\n", + "#maze.print_cost_map()\n", + "\n", + "\n", + "maze.path_find(maze.end, \"v\")\n", + "\n", + "map2 = maze.cost_map.copy()\n", + "#maze.print_cost_map()\n", + "\n", + "map_sum = { k : {\"cost\": v[\"cost\"] + map2[k][\"cost\"] , \"dir\":v[\"dir\"], \"from\":v[\"from\"]} for k, v in map1.items()}\n", + "\n", + "#maze.print_cost_map(map_sum)\n", + "\n", + "ret2 = len([k for k,v in map_sum.items() if v[\"cost\"] in [ret1, ret1-1000,ret1+1000]])\n", + "\n", + "#maze.print_tiles_map()\n", + "\n", + "\n", + "\n", + "print (f\"The solution of for part 2 is: {ret2}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "#############################################################################################################################################\n", + "# # # # #███████████████████# # # # # █████████████████████# █#\n", + "# ### ### ### ##### ####### ####### #█# ##### #########█##### ### # # ### # ### # ##### ##### # ########### ###█#█#█###█###█#######█# #####█#\n", + "# # # # # # # # # # #█# # # #█#█████████ # # # # # # # # #█████# #███████████████ #█# # #█#\n", + "# # # # # # ### # # # ####### ### # #█# ### ### ##### #█#█# # ###█##### # ####### # ##### # #########█###█###█####### # # ### ### #█### # #█#\n", + "# # # # # # # # # # # #█# # # # #███# # █ # # # # # # #███████# #█████# # # # # #███# #█#\n", + "# # ### ##### # ########### ### # # #█### ####### # ### ##### ###█### # ### ### ##### # # ### #█####### ####### # ### ##### # # ### #█### #█#\n", + "# # # # # # # # #█# # # # # # # █ # # # # # #███# # # # # # #███# #█#\n", + "# # ############# ##### ####### # # #█# ### # ### # # ### ### # #█# ### # ##### # # ##### # #####█# # # ########### ####### # ##### ###█###█#\n", + "# # # #███# # #█████#█ █# # # # # # #█ # # # # # # # #█# # # # # # # # # #█████#\n", + "# # # ### # #█#█##### ##### #█###█# #█############# ##### ### # #█### # ### ### ### # # # ### # #█# # # # # # ##### # # # ##### # # # ##### #\n", + "# ███████#█ #███████ #█████ # # # # # #█# # # # # # # # # #█ # # # # # # # # # # # # #\n", + "# # ###█#######█#######█####### ### ### # # ### ####### ##### ###█# ### # # # # ### # ### # # # #█### # # # # # ##### ############# ##### # #\n", + "# #███# # █ █#███# # # # # # # # # # #███# # # # # # # # ███ # # # # # # # #\n", + "### #█### # # #█### #█### # # # # # # ####### ### # ### # ### #█####### # # # # ##### # # ### #█# # ####### # # ### ####### # ### # # ### # #\n", + "# # # # #█ # #█# # # # # # # # # # # # #█#█████# # # # # # #█# # # # # # # # # # #\n", + "# # #█# #######█### #█# ########### # # # # # # ### # ##### ###█#█# #█# ### # ##### ### #######█# # # ##### # ####### # ########### # ##### #\n", + "# #█# # #███████# # # # # # # # # # # # ███# #█# # # #███# # #█████# # # # # # # # # # # #\n", + "# # #█# # ### ######### # # ### # ### ### ##### ####### # ### ### # #█### # ###█#█####### #█### ### # ############# ### # # # ### # # # #####\n", + "# #█# # # # # # # # # # # # # #█ # # #███#███████ #█# # # # # # # # # # #\n", + "### #█##### ####### ##### ### ######### ##### ##### # ########### # #█### # #█#########█###█# # ##### # ######### ### ##### # ######### # # #\n", + "# #█# # # # # # # #█# # #█# #█████# # # # # # # # # # # #\n", + "# ###█### ### ### ##### ### # # ### # ########### # ### ####### #####█# ### #█# ######### ##### # ####### # ####### ### # # ############### #\n", + "# #███# # # # # # # # # # # # # # # #█# #███ # # # # # # # # # # # #\n", + "# # ###█####### ### # ### # ### # ##### ### ### # ### ##### # ##### #█### #█### # ##### ### # ####### # # ########### ### ### ### ### # # # #\n", + "# # #███# # # # # # # # # # # # # # #█ #███ # # # # # # # # # # # # # # # # # #\n", + "# # #####█# ##### # ### # ### # ########### # # ####### ### ### # ###█###█### # # # # ### ####### ####### # # # ### ### ### # # ### ### # # #\n", + "# # # █# # # # # # # # # # # # # # # █████# # # # # # # # # # # # # # # # #\n", + "### # ###█# # # ######### # # ######### # # ### # # ##### # # # # ##### # # ### # # ### ####### ########### ##### # # ### # ### ### # # ### #\n", + "# # #█ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # ### #█# ##### # ####### ##### # ### ####### # # # # # # ### ######### ### ##### # ####### # ### # ### # # # # ######### # # ### # ### # #\n", + "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ### ###█### # # # # ### # ##### # # # ### # ##### # ##### # # ##### # ### ########### # ####### ##### ##### # # ####### # ### # ####### ###\n", + "# # # #█ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "### # # #█# # # # ##### # ##### ####### # # # ### ### ### # # ########### ### # ### # ### # # ####### # ##### ##### ### # # # # ####### # # #\n", + "# ███ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ### #█#█# # # ##### ####### # # ### # # # ### ##### ####### ### # # # ### ### # ######### ####### ### # # ### # # # # # # # # # # # ##### #\n", + "# # #███ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# #####█#█### ### # ### # ######### # ####### ######### ### # ######### # ### # # # # # # # ### # ### # ##### ### # # ### # ### ### ####### #\n", + "# #███ # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ### #█#█##### ### ####### ##### ########### # # ### ### ### # # ### ####### ### ### ##### # ##### # # # # # # ### ##### ### ##### # # # ###\n", + "# # █#█ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # ###█#█# # # ##### ### # ### # # # ##### ####### ### # # ####### ####### # ##### # ### ### ### ############# ####### ### ##### ### ### # #\n", + "# # ███# # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ### #█# ####### # ##### ### ### ####### # ##### # ########### # ### # ### ### ##### # ####### ### # # ######### # ### ####### # # ### ### #\n", + "# # █# # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "### ###█# ### ### # # # ### # # ##### ##### # # # ######### # # ############# # # ##### # # ##### ########### # ### # # # ### ##### # #######\n", + "# # ███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█#█### # # ######### ##### ### # # ####### # # ####### ### # # ### # # ### # # ### ### # # ####### # ##### # # # # ### # ######### ### #\n", + "# # ███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # #█#█# ### ### # ### # # # ### ### # # # # ####### ####### ##### # ### ####### ####### # # # # # ##### ### ### # # # # # ######### # # # #\n", + "# #███ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█#█### # ### ### ##### ### # ##### ### ### ### ##### ##### # ##### ### ########### # # # # ### # # ### # # ##### # # ### # ### ### # # #\n", + "# # █#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█#█# # # # ### ######### ### ##### ##### ### ### # # # # # ### # # ########### # # # ### ### ### # # ##### # ### ##### # # # ### ### # #\n", + "# ███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#####█##### # ### # ### # # ####### ##### # ####### ### # ### ### # # ##### ### ##### # ### ### ### # ### ####### # ### ##### ######### ### #\n", + "# █# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█# # # # # # # ######### # # # # ##### # ### # # ##### ### # ### # ##### ### # # # ##### ### ##### ####### ##### ##### ##### # ### # ###\n", + "# # █ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█### ### # # ### # ### # ######### # ##### # ### ### ##### # # # ##### # # # ######### # # ##### ### ####### # ######### # ### # ##### #\n", + "# # █# # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # #█######### ### ### # ##### # # # ### ### ### # ### # # # ### ####### # ### ### # # # ####### ##### ### # ### ### ######### # # # ##### #\n", + "# █ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # #█####### ### # # ### ### # # # # ##### ### ### # # # # ### ### # # ##### ####### # # # ####### # ### # ### # # ### ### # ### ##### # ###\n", + "# █ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#####█# # # ### ### ####### ### ####### # # ### # ### # # ### # # # ##### ### # ### ######### # # # ### ############# ######### # ##### ### #\n", + "#█████ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# ####### ### # ### # # ####### # # ### # # # # # # ####### # # ######### # ### ### ##### ### # ### ### ##### # # ### # # ##### # # ##### #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█####### ### # # # # # ### ######### # # ### ### # ### # ##### ### # ### # ### # ##### # ######### # ####### ########### # # # ### ####### #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # # ######### ### ### # ##### # ####### # ####### # ### # # # ### # ##### ### ####### ### # ##### # ####### ####### ########### ### # # #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # # ### # ##### # # ##### # # # # ### ##### # # ######### ##### ### # ##### ### ##### # # # # ####### # ##### # # ##### # # ##### ##### #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # # # ##### ### ##### ######### # # ### ##### ### # ######### # # # ##### # # ### ##### # # ### # ##### # ### ##### ######### # ### # ###\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█##### ##### # ### # ### # ### ######### ### ### # # # # ### # # ### # # ################### ### ### # ##### # ############# ############# #\n", + "# # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█##### ### # ### ### ####### ####### # ####### ##### ####### ### # # ##### # ############# # # ##### ####### # # ### # # ##### ### ### ### #\n", + "#███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "###█# # ### ### # # ### ######### ####### # # ### # ### ##### # ##### # # # # ### ### # ### ####### # # # ##### # # # # # # # ### # # #######\n", + "# #███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█### # # # # ####### # ### # # ##### ### # ####### # ####### # # # # # ### # ####### ### # # # # # ##### ##### # ### # # # ##### # ### #\n", + "#█████# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█##### ########### # ####### # # # # ##### ##### ### # # ##### ######### ### ### ########### # ### # ### # # # # # ### # # ### ### ##### # #\n", + "#███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "###█# # # ### ### ### ######### ### ### # ### # # # # ### # # ######### ##### # # ### ######### # ### ##### ####### # # ##### ### ###########\n", + "#███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█### ##### ############### # ### # # ########### # # # ### # # ##### ##### ##### # ### ### ####### # # ##### ### ### ########### ##### # # #\n", + "#███████ # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#######█############# # ##### # # ### # ##### # # # ### # ### ##### # # # ### # # # ######### # # ############# ### ########### ### # ##### #\n", + "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # ###█##### ### ### ##### # # ### ### # # # ### ### # ### # # ### ####### # # ########### ### ########### ### # # ##### # # ### ####### # #\n", + "# # █ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# #####█### ##### # # # ##### # # ### ##### ### ##### # # ### ### ##### # # # ### # # ### # # ### # # ### ### ##### # ##### ### # ####### # #\n", + "# #███ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "### #█# # # # # # # # ### ### ### # ######### ### # ### # # ####### # ######### # # # ### # ### # # ##### # ######### # # ##### ### # ### # #\n", + "# #█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # #█# # # ##### # # # # # ### ##### # ##### # ### ######### ### # ####### # # # ### # ##### ### # # ####### ### # ### ##### # # ##### # # #\n", + "# #███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# #█#█# ####### # ### ##### ##### # # ### ##### # ### ##### # ####### # ################### ### # # ##### # # # ##### # # # ### ### # # # ###\n", + "# ███# # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "###█##### # # ##### ### # ### # # # # # ### # ######### ####### ##### ### # ##### # ##### # # # ##### # ### ##### ####### ### # # ### # # # #\n", + "# █ # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "###█############# # # # ######### # ### # ##### # ##### # ####### # # ######### ##### # ### ### # ##### # ### # ### ####### ####### # # # # #\n", + "#███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # ##### ######### ### # ### ########### # ########### # # ####### ### ### # ### # ### ### # # ### # ### # ### # # # # ### ####### ### # #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # # # ################# # ### # # # # ### ### ######### ### ### ### ### # ### ##### ##### ############# # # # # # # # # # ### # ##### # #\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█####### # ##### # # # # # ### ##### # # ##### # # ### # # # ### # # ##### ### ##### ############# ######### # # ##### # # # # # ####### ###\n", + "#█████ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ###█####### ### # # ### # ####### # # ##### ##### # # # # ### # ##### ##### ### # ####### # ####### # # ##### ######### # # ##### ##### # #\n", + "# # #███████████# # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# # ####### ###█# ##### # # # ### ##### # ### # ####### ##### ##### ####### # # # ########### # # ######### # # ### ####### # # ### # # # ###\n", + "# # # # #█# # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "### # # # #####█### # ### ### # ##### ##### ##### ##### # ######### # # # ### ##### ##### ##### ######### # # # # ####### ####### # # ##### #\n", + "# # # #█ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "####### ##### #█# # # ### ### ### # ##### # ### ### # # # # ### # ### # ### ### ##### # ### # # # # # ### ######### ### ##### # # # ##### # #\n", + "# # # #█ # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "# ######### # #█# # ### ### ##### ### # # ##### # ####### # # # ### # ### # ####### ######### # ####### ### ######### # # # # # # # # # ### #\n", + "#█████████████#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█# # # #█# #█#█##### ### # # # # # ### # # ######### # ### # ### ##### ### # ### ##### # ####### # # ### # # ### # ### # ##### ### ### # ###\n", + "#█# # #█# #█#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█#######█###█#█# ##### ####### ##### # ### # ##### # ### # # # ############# # # # # # ### # ##### ### # ### # ##### ####### # # # ### ### #\n", + "#█ #███████# # # # # # # # # # # # # # # # # # # # # #\n", + "#█##### ######### # ### # # ### ### # ##### ### # ### # # ### ### # ### ### ######### ######### # ### ### ### # # # ####### ##### # # ### ###\n", + "#█# # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█### ### # # # ### # # # # # ### ### # ### ##### # ##### # # ### ##### # ### ### ############# # # # # # # # ### # ### # # ### # # # # # # #\n", + "#█#█████# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█#█###█##### # # ### # ### # # ########### ### # ##### # # ### ##### # ##### # ############# # # # # ### ### # ##### ##### # ### # ####### #\n", + "#███# #█ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "##### #█### ##### # # ### # # ### # ### # # ##### # ### # ### # # ##### # ##### ### # # # # # ### # ##### ### ### # # ##### # ##### ### # # #\n", + "#███#███ # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█#█#█################### # ### ##### # ### # ##### # ### # ####### ### # ##### # ######### ####### # # # ### ##### ##### # # # ### # ### # #\n", + "#█#███# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n", + "#█####### ####### # # # ### # ### # ##### # ### # ##### # ### # # ##### # # # # # # ############# ####### # ### # ####### # # ### # ### ### #\n", + "#█ # # # # # # # # # # # # # # # # # #\n", + "#############################################################################################################################################\n", + "\n" + ] + } + ], + "source": [ + "# To solve use the count for part 2 but check the map to find few miscounted tiles.\n", + "exit_path = { i: (k, v[\"dir\"]) for i, (k, v) in enumerate(map_sum.items()) if v[\"cost\"] in [ret1, ret1-1000,ret1+1000] }\n", + "maze.print_exit_map(char = \"█\", exit_path= exit_path)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day16/input.txt b/solutions/alv67/day16/input.txt new file mode 100644 index 0000000..fff6db6 --- /dev/null +++ b/solutions/alv67/day16/input.txt @@ -0,0 +1,141 @@ +############################################################################################################################################# +#...#.......#.............#.........#...................#.............#.....#.....#...........#.....................................#......E# +#.###.###.###.#####.#######.#######.#.#.#####.#########.#####.###.#.#.###.#.###.#.#####.#####.#.###########.###.#.#.###.###.#######.#.#####.# +#...#.#.#.#...#...#.#.......#.....#.#.#.#.....#.......#.#...........#...#.#.....#.#.....#.#...#.....#.....#.#.....................#.#...#.#.# +#.#.#.#.#.#.###.#.#.#.#######.###.#.#.#.###.###.#####.#.#.#.#.###.#####.#.#######.#.#####.#.#########.###.###.#######.#.#.###.###.#.###.#.#.# +#.#.#...#...#...#.#.......#...#.#.#.#.#...#...#...#...#...#.#.........#...#.....#...#...#.#...#.......#.#.....#.......#...#.#.#...#...#...#.# +#.#.###.#####.#.###########.###.#.#.#.###.#######.#.###.#####.###.###.#.###.###.#####.#.#.###.#.#######.#######.#.###.#####.#.#.###.#.###.#.# +#.#.....#.....#.......#.....#...#.#.#.#...#.....#.#.#...#.....#.....#...#.........#...#...#...#...#...#.........#...#.......#.#.....#...#.#.# +#.#.#############.#####.#######.#.#.#.#.###.#.###.#.#.###.###.#.#.#.###.#.#####.#.#.#####.#.#####.#.#.#.###########.#######.#.#####.###.###.# +#.#.#.......#...#.....#.....#.....#...#.....#.....#.#...#.#.....#.....#.#.#.....#...#...#...#...#.#.#.#.#...#.......#...#.....#...#...#.....# +#.#.#.###.#.#.#.#####.#####.#.###.#.#.#############.#####.###.#.#.###.#.###.###.###.#.#.#.###.#.#.#.#.#.#.#.#.#####.#.#.#.#####.#.#.#.#####.# +#.............#.......#.........#.......#...#.....#.....#.....#.#.#...#...#.#.....#.#.#...#...#.#...#.#.#.#.#.#.....#.#...#.....#...#.....#.# +#.#.###.#######.#######.#######.###.###.#.#.###.#######.#####.###.#.###.#.#.#.#.###.#.###.#.#.#.#.###.#.#.#.#.#.#####.#############.#####.#.# +#...#...#...#.......#...#...#...#.#.#.#...#...#.......#.....#.#...#.....#.#.#.#.....#.#...#...........#...#.#...............#.....#.#.....#.# +###.#.###.#.#.#.###.#.###.#.#.#.#.#.#.#######.###.#.###.#.###.#.#######.#.#.#.#.#####.#.#.###.#.#.#.#######.#.#.###.#######.#.###.#.#.###.#.# +#.#...#...#...#...#.#.#...#...#...#.#...#...#.#...#.#...#.#...#.#.....#...#.#.....#...#.#.....#.#.#.#.....#.#.#...............#.....#.#...#.# +#.#.#.#.#######.###.#.#.###########.#.#.#.#.#.#.###.#.#####.###.#.#.#.#.###.#.#####.###.#######.#.#.#.#####.#.#######.#.###########.#.#####.# +#...#.#.#.....#.......#...#.....#...#.#.#.#...#.#...#...#...#.....#.#.#...#.#.#...#.....#.#.....#.#.#.......#.......#.#.#...#.....#.#.#.....# +#.#.#.#.#.###.#########.#.#.###.#.###.###.#####.#######.#.###.###.#.#.###.#.###.#.#######.#.###.###.#.#############.###.#.#.#.###.#.#.#.##### +#...#.#...#.#.......#...#...#.#...#.....#.....#.......#...#.......#.#...#.#.#...#.........#.#.......#.#...........#...#...#.#.#.......#.#...# +###.#.#####.#######.#####.###.#########.#####.#####.#.###########.#.#.###.#.#.#########.###.#.#.#####.#.#########.###.#####.#.#########.#.#.# +#...#.#...........#.....#...#.#...................#.#...............#.#...#.#.#.......#.....#.#.#.....#...#.....#...#.....#.#...........#.#.# +#.###.###.###.###.#####.###.#.#.###.#.###########.#.###.#######.#####.#.###.#.#.#########.#####.#.#######.#.#######.###.#.#.###############.# +#...#...#...#...#...#.#...#.#...#...#.#.........#.#.#...#.....#.....#.#...#.....#.......#...#...#...#...#.#.............#...#.......#.....#.# +#.#.###.#######.###.#.###.#.###.#.#####.###.###.#.###.#####.#.#####.#.###.#.###.#.#####.###.#.#######.#.#.###########.###.###.###.###.#.#.#.# +#.#...#...#.....#.#.#...#.#...#.#.........#...#.#.....#.....#...#...#...#.....#...#.#...#.#...#.......#...#...#.....#.#...#...#...#...#.#.#.# +#.#.#####.#.#####.#.###.#.###.#.###########.#.#.#######.###.###.#.###.###.###.#.#.#.#.###.#######.#######.#.#.#.###.###.###.#.#.###.###.#.#.# +#.#.#.....#.#.#.........#.#.#.#.........#...#.....#.....#...#.#.#.#.......#...#.#.#.....#.........#.......#.#...#.#.#...#.#.#.........#.#...# +###.#.###.#.#.#.#########.#.#.#########.#.#.###.#.#.#####.#.#.#.#.#####.#.#.###.#.#.###.#######.###########.#####.#.#.###.#.###.###.#.#.###.# +#...#...#...#.....#.......#.#.....#...#.#.......#.#.#...#.#.#...#.........#...#.#...#.#.......#.....#.....#.#.#...#...#.....#.......#.#...#.# +#.#.###.#.#.#####.#.#######.#####.#.###.#######.#.#.#.#.#.#.###.#########.###.#####.#.#######.#.###.#.###.#.#.#.#.#########.#.#.###.#.###.#.# +#.#.......#...#.#.#.#...........#.#...#.#...#...#.....#...#...#.#.......#...#...........#.....#...#...#.#...#.#.#...........#...#...#...#.#.# +#.###.###.###.#.#.#.#.###.#.#####.#.#.#.###.#.#####.#.#####.#.#.#####.#.###.###########.#.#######.#####.#####.#.#.#######.#.###.#.#######.### +#...#.#.#...#.#.#.#.....#.#.......#.#...#...#.#.....#.#.....#.#.......#.#...#.....#...#.#.#.#.....#.........#...#...#...#.#.#.#.#.......#...# +###.#.#.#.#.#.#.#.#####.#.#####.#######.#.#.#.###.###.###.#.#.###########.###.#.###.#.###.#.#.#######.#.#####.#####.###.#.#.#.#.#######.#.#.# +#.............#.#.....#.......#.#.....#.#.#.#...#...#.....#.#.....#...#...#...#.#...#.....#.#.......#.#...#...#...#.....#.#.#...............# +#.###.#.#.#.#.#.#####.#######.#.#.###.#.#.#.###.#####.#######.###.#.#.#.###.###.#.#########.#######.###.#.#.###.#.#.#.#.#.#.#.#.#.#.#.#####.# +#.#...#.....#.#...#...#.#.....#...#...#.......#.......#.........#...#...#...#...#.#.......#...#...#...#.#...#...#.#.#.#.#.#...#...#.#.......# +#.#####.#.###.###.#.###.#.#########.#.#######.#########.###.#.#########.#.###.#.#.#.#.#.#.#.###.#.###.#.#####.###.#.#.###.#.###.###.#######.# +#.....#.......#...#.....#...#...................#...#...#...#...#.....#...#.....#.#.#...#...#...#...#...#...#.....#.#.....#.#...#.......#...# +#.###.#.#.#####.###.#######.#####.###########.#.#.###.###.###.#.#.###.#######.###.###.#####.#.#####.#.#.#.#.#.#.###.#####.###.#####.#.#.#.### +#.#.....#.....#.....#.....#.....#.#.........#.....#...#.#.#...#...#.#.......#...#...#.....#.#.#...#...#...#...#...#.........#.....#.#.#.#.#.# +#.#.###.#.#.#.#.#####.###.#.###.#.#.#.#####.#######.###.#.#.#######.#######.#.#####.#.###.###.###.#############.#######.###.#####.###.###.#.# +#.#.......#.....#.#...#...#.#...#.#.#.....#.......#.#.......#.......#.....#.#.#.....#.#.#.....#.....#...........#.......#.......#.#...#...#.# +#.###.#.#.#######.#.#####.###.###.#######.#.#####.#.###########.#.###.#.###.###.#####.#.#######.###.#.#.#########.#.###.#######.#.#.###.###.# +#...#...#...........#...#...#.#.#.........#.#...#.#...........#.#.....#.......#.#.....#...#.......#...#.......#...#...#.#.....#...#.#.......# +###.###.#.###.###.#.#.#.###.#.#.#####.#####.#.#.#.#########.#.#.#############.#.#.#####.#.#.#####.###########.#.###.#.#.#.###.#####.#.####### +#.#.....#...#.#...#...#...#...#.....#.#.......#.#.#...........#.#.....#...#...#.#.#.....#.#.#...#.......#.....#...#.#.#.#...#.#.......#.....# +#.###.#.###.#.#.#########.#####.###.#.#.#######.#.#.#######.###.#.#.###.#.#.###.#.#.###.###.#.#.#######.#.#####.#.#.#.#.###.#.#########.###.# +#.#.....#...#.#.......#...#...#.#...#.#.#...#...#...#.........#.....#...#.#.....#.#...#.....#.#...#.....#.#.....#.#.#.#.#.#.#.........#.#.#.# +#.#.#.#.#.###.###.#.###.#.#.#.###.###.#.#.#.#.#######.#######.#####.#.###.#######.#######.#.#.#.#.#.#####.###.###.#.#.#.#.#.#########.#.#.#.# +#...#.....#.....#.......#...#...#.....#.#.#.#...#.....#.....#...#...#...#...#.............#.#.#.#...#...#...#.#...#.#.#.#.#...#...#...#.#.#.# +#.###.#.###.#.###.###.#####.###.#.#####.###.###.###.#####.#####.#.#####.###.###########.#.#.#.#.###.#.#.###.#.#.#####.#.#.###.#.###.###.#.#.# +#.#...#.#.#.#.#...#.#.......#...#.....#.......#.........#.#...#.#...#.#.#.............#.#.#.....#...#...#...#.#.#.....#.....#.#.#...#...#...# +#.###.#.#.#.#.#.###.#########.###.#####.#####.###.###.#.#.#.#.#.###.#.#.###########.#.#.#.###.###.###.#.#.#####.#.###.#####.#.#.#.###.###.#.# +#.......#...#.#...#.....#.#...#...#.....#.......#...#.#.#...#.#...#.#.#.....#.......#.#.#...#.#...#.#.#.........#...#.#.....#.#.......#.#...# +#####.#####.#.###.#.###.#.#.#######.#####.#.#######.###.#.###.###.#.#.#####.###.#####.#.###.###.###.#.###.#######.#.###.#####.#########.###.# +#.....#...#.#...#.#.#.....#...#...#.#.....#.#.....#.#...#.#.....#.#...#.....#...#...#.#.....#...#.....#.........#.#...#.....#.....#.....#...# +#.###.#.#.#.#.#.#.#.#########.#.#.#.#.#####.#.###.#.#.#####.###.#.###.#.#####.###.#.#.#.#####.###.#####.#######.#####.#####.#####.#.###.#.### +#.#.....#.#...#.#.#...#.....#...#.......#.#...#.#...#.....#.....#.#.#.#.....#...#.....#.....#.#.....#...#.......#.........#...#...#.#.#...#.# +#.###.###.###.#.#.###.#.###.#.#########.#.#####.#.###.###.#####.#.#.#.#####.#.#.#.#########.#.#.#####.###.#######.#.#########.#.###.#.#####.# +#.#...#.........#.....#.#...#...#...#...#.....#...#...#...#...#.....#.....#.#.#...#...#...#...#.#.....#...#.#.....#.#.......................# +#.#.#.#########.###.###.#.#####.#.#.#.###.###.###.#.###.#.#.#.###.#######.#.###.###.#.#.#.#######.#####.###.#.###.###.#########.#.#.#.#####.# +#.............#...#.#...#.....#...#.#.#.....#.....#.#...#.#.#...#.#...#...#...#.......#.#.........#...#...#.#...#.#.........#...#.#...#.#...# +#.#.#.#######.###.#.#.###.###.#.#.#.#.#####.###.###.#.#.#.#.###.###.#.#.#####.#######.#.#.#.#######.#.###.#.###.#.#.###.###.#.###.#####.#.### +#.......#...#...#.#.#.......#.....#...#...#.#...#...#.#.#...#.#.....#...#...#.#.....#...#...#.......#.#...#.....#.......#...#...#.....#...#.# +#####.#.#.#.###.###.#######.###.#######.#.#.###.#.###.#.#.###.#.#.#.#####.###.#.###.#########.#.#.#.###.#############.#########.#.#####.###.# +#.........#...#.#...#.#.....#...#...#...#.#...#.#.#...#.#.....#.#.#.........#.#...#.........#.......#...#.......#...#.#...#.....#...#...#...# +#.#.#######.###.#.###.#.#.#######.#.#.###.#.#.#.#.#.#.#######.#.#.#########.#.###.###.#####.###.#.###.###.#####.#.#.###.#.#.#####.#.#.#####.# +#.#.......#.#...#.#...#.#.........#...#.#.#.#.#...#.#.........#.#...#.......#...#.#...#...#.....#...#.#.......#.........#.#...#...#.#.......# +#.#######.###.#.#.#.#.#.###.#########.#.#.###.###.#.###.#.#####.###.#.###.#.###.#.#####.#.#########.#.#######.###########.#.#.#.###.#######.# +#.#.#.........#.#.#.#.#...#.....#...#...#...........#...#.#...#...#...#.#...#...#.......#.....#.....#.#.......#.........#.....#...#.....#.#.# +#.#.#.#.#########.###.###.#.#####.#.#######.#.#######.#.###.#.#.#.###.#.#####.###.#######.###.#.#####.#.#######.#######.###########.###.#.#.# +#.#.#.#.....#.....#...#.#...#...#...#.......#.#...#...#.....#.#.#.....#.#.....#.#...#.......#.#.#.....#...#.....#...#.......#.......#.....#.# +#.#.#.#.###.#.#####.#.#.#####.#.#.#.#.###.#####.#.#.#########.#####.###.#.#####.###.#####.#.#.#.#.#######.#.#####.#.#.#####.#.#.#####.#####.# +#.#.#.#.............#...#.....#...#.#.#...#.....#.#...#.....#.....#.#.#.#.....#.#...#.....#.#.#.#...#.....#.#...#.....#.....#.#...#.#...#...# +#.#.#.#.#.#####.###.#####.#########.#.#.###.#####.###.#.#########.#.#.#.#####.#.#.###.#####.#.#.###.#.#####.#.###.#####.#########.#.###.#.### +#.#...#.......#...#.#...........#.....#.#...#...#...#.#.#.......#.#...#.#.....#.......#.....#.#.#...#.#.....#.#...#...............#.....#...# +#.#####.#####.#.###.#.###.#.###.#########.###.###.#.#.#.#.###.#.#.###.#.#.###################.###.###.#.#####.#.#############.#############.# +#...........#.#.#...#.#...#...........#.......#...#.#.#.....#.#.#...#.#...#.......................#...#.......#.#.....#.#.....#...........#.# +#.#####.###.#.###.###.#######.#######.#.#######.#####.#######.###.#.#.#####.#.#############.#.#.#####.#######.#.#.###.#.#.#####.###.###.###.# +#...#.....#.#...#.#...#.......#.....#...#...#...#...#.........#.....#.#...#.#.#.......#...#...#.....#.#.#.....#.#.#.#.#...#...#...#.........# +###.#.#.###.###.#.#.###.#########.#######.#.#.###.#.###.#####.#.#####.#.#.#.#.###.###.#.###.#######.#.#.#.#####.#.#.#.#.#.#.#.###.#.#.####### +#.#...#.#...#.#.#.#.....#...#.....#.......#...#...#.....#.......#...#.#.#.#.#...#.#.....#...#.......#.#.......#...#.#.#...#.#.#...#.#...#...# +#.###.###.#.#.#.#.#######.#.###.#.#.#####.###.#.#######.#.#######.#.#.#.#.#.###.#.#######.###.#.#.#.#.#.#####.#####.#.###.#.#.#.#####.#.###.# +#.....#...#...#.....#.....#...#.#.#.#.....#.........#...#.#.......#...#.#...#...#...........#.#.#.#...#.#...#.#...#.#...#.#.#.#.#.....#...#.# +#.#####.###########.#.#######.#.#.#.#.#####.#####.###.#.#.#####.#########.###.###.###########.#.###.#.###.#.#.#.#.#.###.#.#.###.###.#####.#.# +#...#.#.#.......#...#.#.........#.#.#.#...#.........#.#...#...#.........#...#.#.#...#.........#.#...#.....#.#...#...#.#.#...#...#...#.......# +###.#.#.#.###.###.###.#########.###.###.#.###.#.#.#.#.###.#.#.#########.#####.#.#.###.#########.#.###.#####.#######.#.#.#####.###.########### +#...#.#...#.#.....#.........#...#...#...#.....#...#.#...#.#.#.#.......#.......#...#...#.......#...#.#.#.....#.....#...#.......#.........#...# +#.###.#####.###############.#.###.#.#.###########.#.#.#.###.#.#.#####.#####.#####.#.###.###.#######.#.#.#####.###.###.###########.#####.#.#.# +#.....................#.....#.#...#.#.#.........#.#.#.#.#...#.#.....#.#...#.#...#.#.#.....#.......#...#.............#...........#...#.#...#.# +#######.#############.#.#####.#.#.###.#.#####.#.#.#.###.#.###.#####.#.#.#.###.#.#.#.#########.#.#.#############.###.###########.###.#.#####.# +#.............#.....#.#.....#.#.#.#...#.#...#.#.#.#...#.#...#.....#.#...#...#.#.#...........#.#.#...........#.....#.#.......#.#...#.......#.# +#.#.###.#####.###.###.#####.#.#.###.###.#.#.#.###.###.#.###.#.#.###.#######.#.#.###########.###.###########.###.#.#.#####.#.#.###.#######.#.# +#.#.........#.....#...#.....#.#.....#.....#...#...#...#.#...#.#.#.......#.#.#.#.....#.....#.#...#...#.....#...#...#.#.....#.#...#.#.......#.# +#.#####.###.#####.#.#.#.#####.#.#.###.#####.###.#####.#.#.###.###.#####.#.#.#.###.#.#.###.#.#.###.#.#.###.###.#####.#.#####.###.#.#######.#.# +#...#...........#.#.#...#...#.#.......#.....#...#...#...#.#.#.....#...#...#.......#.#...#.#.#...#.#.#...#...#.......#.#...#.....#...#.....#.# +###.#.#.#.#.#.#.#.#.#.###.###.###.#.#########.###.#.###.#.#.#######.#.#########.#.#.#.###.#.###.#.#.#####.#.#########.#.#.#####.###.#.###.#.# +#...#.#...#.#.#...#.#.#.#...#...#.#...#.......#...#.#...#.....#...#.#.......#.#.#.#.#.#...#...#...#.#.........#.......#.#.....#.#.#...#...#.# +#.#.#.#.#.#.#####.#.#.#.#.#.###.#####.#.#####.#.###.#########.###.#.#######.#.#.#.###.#.#####.###.#.#.#######.###.#.###.#####.#.#.#####.#.#.# +#.#...#...#.....#...#.....#...#.....#.#...#...#.#...#.......#.....#...#.....#.........#.....#...#.#.#.......#.#.....#.#.#.#...#.#.....#.#...# +#.#.#.#.#######.#.###.#####.#####.#.#.###.#####.#.###.#####.#.#######.#.###################.###.#.#.#####.#.#.#.#####.#.#.#.###.###.#.#.#.### +#.....#...#...#...#.............#.#.#...#...#...#.....#...#...#.......#...#.......#.......#...#.#.#...#...#.#...#.........#.............#...# +###.#####.#.#.#####.###.#.###.#.#.#.#.#.###.#.#########.#######.#####.###.#.#####.#.#####.#.#.#.#####.#.###.#####.#######.###.#.#.###.#.#.#.# +#.......#...#.....#.#...#.....#...#.#.#...#...#...............#...#.#.......#...#...#.....#.#.#.#.....#...#.....#.........#.............#.#.# +###.#############.#.#.#.#########.#.###.#.#####.#.#####.#.#######.#.#.#########.#####.#.###.###.#.#####.#.###.#.###.#######.#######.#.#.#.#.# +#...#...........#...#.#.#...#.....#.....#...#...#.......#.#.......#.....#.....#...#...#...#...#.#.....#.#...#.#...#.#.#.....#.........#.....# +#.#.#.#####.#########.###.#.###.###########.#.###########.#.#.#######.###.###.#.###.#.###.###.#.#.###.#.###.#.###.#.#.#.#.###.#######.###.#.# +#.#.......................#...#...#...#.#...#...#.........#.#.#.....#.#.....#.#.....#...#.....#.......#...#.#.#.#.#.#.#.#.#.....#...#.....#.# +#.#.#.#.#.#################.#.###.#.#.#.#.###.###.#########.###.###.###.###.#.###.#####.#####.#############.#.#.#.#.#.#.#.#.#.###.#.#####.#.# +#.#.#...#.#.......#.....#.#...#.#...#.#.#.#.......#.....#...#...#.#.#...#...#...#.....#.......#.............#.#.#.#...#.#.#.#...#.#.........# +#.#######.#.#####.#.#.#.#.#.###.#####.#.#.#####.#.#.###.#.#.#.###.#.#.#####.###.#####.#############.#########.#.#.#####.#.#.#.#.#.#######.### +#.......#...#...#.#.#.#...#.#.......#.#.#.......#.#.#.#.#.#.#...#.#...#.....#...#...#.......#.......#.#.......#.#.......#.#.#.#...#.........# +#.###.#######.###.#.#.###.#.#######.#.#.#####.#####.#.#.#.#.###.#.#####.#####.###.#.#######.#.#######.#.#.#####.#########.#.#.#####.#####.#.# +#.#.#...........#.#.#...#.#.#.....#.....#...#.#.....#.....#...#.....#.......#.#...#.........#.#...#.....#...#.....#.......#.#.#.....#...#...# +#.#.#######.###.#.#####.#.#.#.###.#####.#.###.#.#######.#####.#####.#######.#.#.#.###########.#.#.#########.#.#.###.#######.#.#.###.#.#.#.### +#...#.#...#...#.#.......#.#...#.#.....#...#...#.........#.........#.#...#...#.#...............#.#.........#.#.#.#.......#...#...#...#.#...#.# +###.#.#.#.#####.###.#.###.###.#.#####.#####.#####.#####.#.#########.#.#.#.###.#####.#####.#####.#########.#.#.#.#.#######.#######.#.#.#####.# +#.....#.#.....#...#...#...#.....#...#.....#.#.....#...#.#.#.....#...#.#.#...#...#...#...#.#...#.#.....#.....#.#...#.....#.......#.#...#.....# +#######.#####.#.#.#.#.###.###.###.#.#####.#.###.###.#.#.#.#.###.#.###.#.###.###.#####.#.###.#.#.#.#.#.###.#########.###.#####.#.#.#.#####.#.# +#.......#...#.#...#.#...#...#.....#.....#.#.....#...#.....#.....#...#.#...#...#.......#.....#.#.....#...#.#...........#.#...#...............# +#.#########.#.#.#.#.###.###.#####.###.#.#.#####.#.#######.#.#.#.###.#.###.#.#######.#########.#.#######.###.#########.#.#.#.#.#.#.#.#.#.###.# +#.............#.#.....#...#.#...#...#.#...#.....#.....#...#.#.#.#...#...#...#.....#.....#...#.....#...#...#.#...#...#.#.#.#...#.#.....#.#...# +#.#.#.#.#.#.#.#.#####.###.#.#.#.#.#.###.#.#.#########.#.###.#.###.#####.###.#.###.#####.#.#######.#.#.###.#.#.###.#.###.#.#####.###.###.#.### +#.#.#...#.#.#.#.#.....#...#...#...#.....#...#.......#.#...#.#.#.........#...#.#.#.#...#.#...#.....#.#...#.........#...#.......#...#...#.#...# +#.#######.###.#.#.#####.#######.#####.#.###.#.#####.#.###.#.#.#.#############.#.#.#.#.#.###.#.#####.###.#.###.#.#####.#######.#.#.#.###.###.# +#.......#.......#.#.....#...........#.......#...#.#...#.....#.#...#...........#.......................#.......#.#...#.......#...#.#.#...#...# +#.#####.#########.#.###.#.#.###.###.#.#####.###.#.###.#.#.###.###.#.###.###.#########.#########.#.###.###.###.#.#.#.#######.#####.#.#.###.### +#.#...#...#...#...#.#.#...............#.........#.#...#...#.#...#.#.....#...#.....................#...#.....#...#.#.#.....#.....#...#.#.#...# +#.###.###.#.#.#.###.#.#.#.#.#.###.###.#.###.#####.#.#####.#.#.###.#####.#.###.###.#############.#.#.#.#.#.#.#.###.#.###.#.#.###.#.#.#.#.#.#.# +#.#.....#...#.#.#.#...#.#.#.#.#.#.....#.........#.#.....#...#...#.....#.#...#.#.#.............#.#.................#.....#...#...#.#...#...#.# +#.#.###.#####.#.#.###.#.###.#.#.###########.###.#.#####.#.#.###.#####.#.#####.#.#############.#.#.#.#.###.###.#.#####.#####.#.###.#.#######.# +#...#.#.....#...#...#.#...#.#.#.........#.......#.....#.#.#...#.#.....#.#.....#.....#...#.....#.#.#.#...#.#...#...#...#.....#.#...#.....#...# +#####.#.###.#####.#.#.###.#.#.###.#.###.#.#.#####.#.###.#.###.#.#.#####.#.#####.###.#.#.#.#.#.###.#.#####.###.###.#.#.#####.#.#####.###.#.#.# +#...#.......#.....#.....#.#.#...#.#...#.#...#.....#.#.....#...........................#...#.#.....#...#.........#...#.....#.#.#.....#...#...# +#.#.#.###################.#.###.#####.#.###.#.#####.#.###.#.#######.###.#.#####.#.#########.#######.#.#.#.###.#####.#####.#.#.#.###.#.###.#.# +#.#...#...........#...#...#...#...#...#...#.#.#...#...#...#...#.#...#...#.#...#.#.........#.......#.........#.#...#.....#.#.#.#...#.#...#.#.# +#.#######.#######.#.#.#.###.#.###.#.#####.#.###.#.#####.#.###.#.#.#####.#.#.#.#.#.#.#############.#######.#.###.#.#######.#.#.###.#.###.###.# +#S........#.........#...#...#.......#.....#.....#.......#.......#...........#...#.#.......................#.....#.........#.#.....#.........# +############################################################################################################################################# diff --git a/solutions/alv67/day16/test1.txt b/solutions/alv67/day16/test1.txt new file mode 100644 index 0000000..2c21676 --- /dev/null +++ b/solutions/alv67/day16/test1.txt @@ -0,0 +1,15 @@ +############### +#.......#....E# +#.#.###.#.###.# +#.....#.#...#.# +#.###.#####.#.# +#.#.#.......#.# +#.#.#####.###.# +#...........#.# +###.#.#####.#.# +#...#.....#.#.# +#.#.#.###.#.#.# +#.....#...#.#.# +#.###.#.#.#.#.# +#S..#.....#...# +############### diff --git a/solutions/alv67/day16/test2.txt b/solutions/alv67/day16/test2.txt new file mode 100644 index 0000000..bc61c57 --- /dev/null +++ b/solutions/alv67/day16/test2.txt @@ -0,0 +1,17 @@ +################# +#...#...#...#..E# +#.#.#.#.#.#.#.#.# +#.#.#.#...#...#.# +#.#.#.#.###.#.#.# +#...#.#.#.....#.# +#.#.#.#.#.#####.# +#.#...#.#.#.....# +#.#.#####.#.###.# +#.#.#.......#...# +#.#.###.#####.### +#.#.#...#.....#.# +#.#.#.#####.###.# +#.#.#.........#.# +#.#.#.#########.# +#S#.............# +################# diff --git a/solutions/alv67/day17/day17.ipynb b/solutions/alv67/day17/day17.ipynb new file mode 100644 index 0000000..5ac779e --- /dev/null +++ b/solutions/alv67/day17/day17.ipynb @@ -0,0 +1,265 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 17: Chronospatial Computer ---\n" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution for part 1 is: 1,5,0,3,7,3,0,3,1\n" + ] + } + ], + "source": [ + "# --- Part One ---\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "#filename = \"test.txt\" # decomment to test\n", + "\n", + "class Computer:\n", + " \n", + " def __init__(self):\n", + " # integer registers\n", + " self.registers = { \"A\": 0, \"B\": 0, \"C\": 0}\n", + " # program memory\n", + " self.program = []\n", + " # output\n", + " self.outputs = []\n", + "\n", + " def set_registers(self, a, b=0, c=0):\n", + " self.registers = { \"A\": a, \"B\": b, \"C\": c}\n", + "\n", + " def load_file(self, file_path):\n", + " with open(file_path, 'r') as file:\n", + " lines = file.readlines()\n", + " # parse registers\n", + " for line in lines[:3]: #First three lines for registers\n", + " key, value = line.split(':')\n", + " reg_name = key.strip().split(\" \")[1]\n", + " self.registers[reg_name] = int(value.strip())\n", + " # parse program\n", + " program_line = lines[4]\n", + " self.program = list(map(int, program_line.split(':')[1].strip().split(',')))\n", + "\n", + " def run(self, a= None, b=0, c=0):\n", + "\n", + " if a != None:\n", + " self.set_registers(a,b,c)\n", + " #--- helper to resolve combo operands\n", + " def combo(operand):\n", + " if operand <= 3: return operand\n", + " elif operand == 4: return self.registers['A']\n", + " elif operand == 5: return self.registers['B']\n", + " elif operand == 6: return self.registers['C']\n", + " else: raise ValueError(\"Invalid combo operand: 7 is reserved\")\n", + "\n", + " ip = 0 # instruction pointer\n", + " self.outputs = []\n", + " # Run the program\n", + " while ip < len(self.program):\n", + " opcode = self.program[ip]\n", + " operand = self.program[ip +1] if ip + 1 < len(self.program) else 0\n", + "\n", + " if opcode == 0: # adv: A = A // (2 ** resolve_combo(operand))\n", + " self.registers['A'] //= 2 ** combo(operand)\n", + " elif opcode == 1: # bxl: B = B ^ operand (literal)\n", + " self.registers['B'] ^= operand\n", + " elif opcode == 2: # bst: B = resolve_combo(operand) % 8\n", + " self.registers['B'] = combo(operand) % 8\n", + " elif opcode == 3: # jnz: if A != 0, ip = operand (literal)\n", + " if self.registers['A'] != 0:\n", + " ip = operand\n", + " continue\n", + " elif opcode == 4: # bxc: B = B ^ C\n", + " self.registers['B'] ^= self.registers['C']\n", + " elif opcode == 5: # out: outputs.append(resolve_combo(operand) % 8)\n", + " self.outputs.append(combo(operand) % 8)\n", + " elif opcode == 6: # bdv: B = A // (2 ** resolve_combo(operand))\n", + " self.registers['B'] = self.registers['A'] // (2 ** combo(operand))\n", + " elif opcode == 7: # cdv: C = A // (2 ** resolve_combo(operand))\n", + " self.registers['C'] = self.registers['A'] // (2 ** combo(operand))\n", + " else:\n", + " raise ValueError(f\"Invalid opcode: {opcode}\")\n", + " # next instruction\n", + " ip +=2\n", + "\n", + " return self.outputs\n", + "\n", + "\n", + "# ---- main ------\n", + "\n", + "computer = Computer()\n", + "\n", + "computer.load_file(filename)\n", + "\n", + "res1 = ','.join(map(str, computer.run()))\n", + "print(f\"The solution for part 1 is: {res1}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2, 4, 1, 5, 7, 5, 1, 6, 0, 3, 4, 1, 5, 5, 3, 0]\n", + "[3]\n", + "[24, 25, 29, 31]\n", + "[192, 196, 198, 199, 200, 249]\n", + "[1538, 1540, 1542, 1543, 1570, 1572, 1575, 1586, 1588, 1594, 1602, 1604, 1606, 1607, 1992]\n", + "[12306, 12311, 12322, 12326, 12337, 12338, 12343, 12345, 12346, 12348, 12567, 12582, 12601, 12604, 12695, 12710, 12759, 12823, 12838, 12849, 12855, 12857, 12860, 15936, 15939]\n", + "[98579, 98611, 98702, 98766, 98784, 98785, 100659, 100814, 100832, 100833, 101683, 102074, 102707, 102798, 102862, 102880, 102881]\n", + "[788633, 788637, 788639, 788889, 788893, 788895, 789621, 789622, 790133, 790134, 790272, 790277, 790280, 790285, 805273, 805277, 805279, 806517, 806518, 806656, 806661, 806664, 806669, 813465, 813469, 813471, 816597, 821657, 821661, 821663, 822389, 822390, 822901, 822902, 823040, 823045, 823048, 823053]\n", + "[6309066, 6309098, 6309102, 6309114, 6311114, 6311146, 6311150, 6311162, 6316969, 6316974, 6321065, 6321070, 6322179, 6322217, 6322219, 6322222, 6322280, 6322286, 6442186, 6442218, 6442222, 6442234, 6452137, 6452142, 6453251, 6453289, 6453291, 6453294, 6453352, 6453358, 6507722, 6507754, 6507758, 6507770, 6532777, 6532782, 6573258, 6573290, 6573294, 6573306, 6579113, 6579118, 6583209, 6583214, 6584323, 6584361, 6584363, 6584366, 6584424, 6584430]\n", + "[50472914, 50489298, 50535753, 50568521, 50577438, 50577737, 50577758, 50578241, 51537874, 51617097, 51626014, 51626313, 51626334, 51626817, 52062162, 52262217, 52586450, 52632905, 52665673, 52674590, 52674889, 52674910, 52675393]\n", + "[403783319, 403914391, 404286024, 404286027, 404286028, 404548168, 404548171, 404548172, 404619511, 404621896, 404621899, 404621900, 404622071, 404625932, 412302999, 412936776, 412936779, 412936780, 413008119, 413010504, 413010507, 413010508, 413010679, 413014540, 416497303, 418097736, 418097739, 418097740, 420691607, 421063240, 421063243, 421063244, 421325384, 421325387, 421325388, 421396727, 421399112, 421399115, 421399116, 421399287, 421403148]\n", + "[3234288194, 3234288196, 3234288198, 3234288199, 3234288218, 3234288226, 3234288228, 3234288231, 3236385346, 3236385348, 3236385350, 3236385351, 3236385370, 3236385378, 3236385380, 3236385383, 3236975170, 3236975172, 3236975174, 3236975175, 3236975194, 3236975202, 3236975204, 3236975207, 3237007460, 3237007463, 3303494210, 3303494212, 3303494214, 3303494215, 3303494234, 3303494242, 3303494244, 3303494247, 3304084034, 3304084036, 3304084038, 3304084039, 3304084058, 3304084066, 3304084068, 3304084071, 3304116324, 3304116327, 3344781890, 3344781892, 3344781894, 3344781895, 3344781914, 3344781922, 3344781924, 3344781927, 3368505922, 3368505924, 3368505926, 3368505927, 3368505946, 3368505954, 3368505956, 3368505959, 3370603074, 3370603076, 3370603078, 3370603079, 3370603098, 3370603106, 3370603108, 3370603111, 3371192898, 3371192900, 3371192902, 3371192903, 3371192922, 3371192930, 3371192932, 3371192935, 3371225188, 3371225191]\n", + "[25874305558, 25874305745, 25874305750, 25874305810, 25874305814, 25874305826, 25874305850, 25891082774, 25891082961, 25891082966, 25891083026, 25891083030, 25891083042, 25891083066, 25895801366, 25895801553, 25895801558, 25895801618, 25895801622, 25895801634, 25895801658, 25896059682, 25896059706, 26427953686, 26427953873, 26427953878, 26427953938, 26427953942, 26427953954, 26427953978, 26432672278, 26432672465, 26432672470, 26432672530, 26432672534, 26432672546, 26432672570, 26432930594, 26432930618, 26758255126, 26758255313, 26758255318, 26758255378, 26758255382, 26758255394, 26758255418, 26948047382, 26948047569, 26948047574, 26948047634, 26948047638, 26948047650, 26948047674, 26964824598, 26964824785, 26964824790, 26964824850, 26964824854, 26964824866, 26964824890, 26969543190, 26969543377, 26969543382, 26969543442, 26969543446, 26969543458, 26969543482, 26969801506, 26969801530]\n", + "[206994444468, 206994446004, 206994446484, 206994446516, 206994446612, 206994446800, 206994446804, 207128662196, 207128663732, 207128664212, 207128664244, 207128664340, 207128664528, 207128664532, 207166410932, 207166412468, 207166412948, 207166412980, 207166413076, 207166413264, 207166413268, 207168477460, 207168477648, 207168477652, 211423629492, 211423631028, 211423631508, 211423631540, 211423631636, 211423631824, 211423631828, 211461378228, 211461379764, 211461380244, 211461380276, 211461380372, 211461380560, 211461380564, 211463444756, 211463444944, 211463444948, 214066041012, 214066042548, 214066043028, 214066043060, 214066043156, 214066043344, 214066043348, 215584379060, 215584380596, 215584381076, 215584381108, 215584381204, 215584381392, 215584381396, 215718596788, 215718598324, 215718598804, 215718598836, 215718598932, 215718599120, 215718599124, 215756345524, 215756347060, 215756347540, 215756347572, 215756347668, 215756347856, 215756347860, 215758412052, 215758412240, 215758412244]\n", + "[1655955555750, 1655955568038, 1655955571878, 1655955572134, 1655955572902, 1655955574438, 1657029297574, 1657029309862, 1657029313702, 1657029313958, 1657029314726, 1657029316262, 1657331287462, 1657331299750, 1657331303590, 1657331303846, 1657331304614, 1657331306150, 1657347819686, 1657347821222, 1691389035942, 1691389048230, 1691389052070, 1691389052326, 1691389053094, 1691389054630, 1691691025830, 1691691038118, 1691691041958, 1691691042214, 1691691042982, 1691691044518, 1691707558054, 1691707559590, 1712528328102, 1712528340390, 1712528344230, 1712528344486, 1712528345254, 1712528346790, 1724675032486, 1724675044774, 1724675048614, 1724675048870, 1724675049638, 1724675051174, 1725748774310, 1725748786598, 1725748790438, 1725748790694, 1725748791462, 1725748792998, 1726050764198, 1726050776486, 1726050780326, 1726050780582, 1726050781350, 1726050782886, 1726067296422, 1726067297958]\n", + "[13247644446003, 13247644544307, 13247644575027, 13247644577075, 13247644583219, 13247644595507, 13256234380595, 13256234478899, 13256234509619, 13256234511667, 13256234517811, 13256234530099, 13258650299699, 13258650398003, 13258650428723, 13258650430771, 13258650436915, 13258650449203, 13258782557491, 13258782569779, 13531112287539, 13531112385843, 13531112416563, 13531112418611, 13531112424755, 13531112437043, 13533528206643, 13533528304947, 13533528335667, 13533528337715, 13533528343859, 13533528356147, 13533660464435, 13533660476723, 13700226624819, 13700226723123, 13700226753843, 13700226755891, 13700226762035, 13700226774323, 13797400259891, 13797400358195, 13797400388915, 13797400390963, 13797400397107, 13797400409395, 13805990194483, 13805990292787, 13805990323507, 13805990325555, 13805990331699, 13805990343987, 13808406113587, 13808406211891, 13808406242611, 13808406244659, 13808406250803, 13808406263091, 13808538371379, 13808538383667]\n", + "[105981155568026, 105981156354458, 105981156600218, 105981156616602, 105981156665754, 105981156764058, 106049875044762, 106049875831194, 106049876076954, 106049876093338, 106049876142490, 106049876240794, 106069202397594, 106069203184026, 106069203429786, 106069203446170, 106069203495322, 106069203593626, 106070260459930, 106070260558234, 108248898300314, 108248899086746, 108248899332506, 108248899348890, 108248899398042, 108248899496346, 108268225653146, 108268226439578, 108268226685338, 108268226701722, 108268226750874, 108268226849178, 108269283715482, 108269283813786, 109601812998554, 109601813784986, 109601814030746, 109601814047130, 109601814096282, 109601814194586, 110379202079130, 110379202865562, 110379203111322, 110379203127706, 110379203176858, 110379203275162, 110447921555866, 110447922342298, 110447922588058, 110447922604442, 110447922653594, 110447922751898, 110467248908698, 110467249695130, 110467249940890, 110467249957274, 110467250006426, 110467250104730, 110468306971034, 110468307069338]\n", + "[2, 4, 1, 5, 7, 5, 1, 6, 0, 3, 4, 1, 5, 5, 3, 0]\n", + "The solution for part 2 is: 105981155568026\n" + ] + } + ], + "source": [ + "# --- Part Two ---\n", + "# Uses code op Part One\n", + "\n", + "# analizing the program\n", + "#\n", + "# Program: 2,4,1,5,7,5,1,6,0,3,4,1,5,5,3,0\n", + "#\n", + "# Line | Meaning \n", + "# 2 ,4 | b = a % 8\n", + "# 1, 5 | b = b ^ 5\n", + "# 7, 5 | c = a >> b\n", + "# 1, 6 | b = b ^ 6\n", + "# 0, 3 | a = a >> 3\n", + "# 4, 1 | b = b ^ c\n", + "# 5, 5 | out b (if a!=0)\n", + "# 3, 0 | loop\n", + "\n", + "filename = \"input.txt\"\n", + "\n", + "# filename = \"test2.txt\" # decomment to test\n", + "\n", + "\n", + "# ---- main ------\n", + "\n", + "computer = Computer()\n", + "\n", + "computer.load_file(filename)\n", + "\n", + "# Analyzing the program starting from the end and look for all the values of A that result in\n", + "# the last digit of the program. A can only be between 0 and 7. In the code, the last 3 bits are then\n", + "# removed from A (command (0,3)).\n", + "# - The last digit to search for is “0”.\n", + "# The only candidate is [3] because computer.run(3) -> 0.\n", + "# - Moving to the next digit: for each candidate, I start from the value candidate * 8 (candidate << 3).\n", + "# Then I search for all candidates that correctly return the last two digits of the program.\n", + "# In our case [3, 0].\n", + "# the candidates are [24, 25, 29, 31]\n", + "# - continue untill all the digits are checked\n", + " \n", + "program = computer.program\n", + "print (program)\n", + "\n", + "to_check = [0]\n", + "for l in range(len(program)):\n", + " next_to_check = []\n", + " for a in to_check:\n", + " for i in range(8):\n", + " new_a = (a << 3) + i\n", + " if computer.run(new_a) == program[-1-l:]:\n", + " next_to_check.append(new_a)\n", + " to_check = next_to_check\n", + " print(to_check)\n", + "\n", + "ret2 = min(to_check)\n", + "\n", + "# check if res2 is correct\n", + "print(computer.run(ret2))\n", + "\n", + "print(f\"The solution for part 2 is: {ret2}\")\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "24 -> [3, 0]\n", + "25 -> [3, 0]\n", + "26 -> [1, 0]\n", + "27 -> [0, 0]\n", + "28 -> [1, 0]\n", + "29 -> [3, 0]\n", + "30 -> [6, 0]\n", + "31 -> [3, 0]\n" + ] + } + ], + "source": [ + "s = 24\n", + "print(f\"{s+0} -> {computer.run(s+0)}\")\n", + "print(f\"{s+1} -> {computer.run(s+1)}\")\n", + "print(f\"{s+2} -> {computer.run(s+2)}\")\n", + "print(f\"{s+3} -> {computer.run(s+3)}\")\n", + "print(f\"{s+4} -> {computer.run(s+4)}\")\n", + "print(f\"{s+5} -> {computer.run(s+5)}\")\n", + "print(f\"{s+6} -> {computer.run(s+6)}\")\n", + "print(f\"{s+7} -> {computer.run(s+7)}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day17/input.txt b/solutions/alv67/day17/input.txt new file mode 100644 index 0000000..6f4b7f4 --- /dev/null +++ b/solutions/alv67/day17/input.txt @@ -0,0 +1,5 @@ +Register A: 44374556 +Register B: 0 +Register C: 0 + +Program: 2,4,1,5,7,5,1,6,0,3,4,1,5,5,3,0 diff --git a/solutions/alv67/day17/test.txt b/solutions/alv67/day17/test.txt new file mode 100644 index 0000000..f09839b --- /dev/null +++ b/solutions/alv67/day17/test.txt @@ -0,0 +1,5 @@ +Register A: 729 +Register B: 0 +Register C: 0 + +Program: 0,1,5,4,3,0 diff --git a/solutions/alv67/day17/test2.txt b/solutions/alv67/day17/test2.txt new file mode 100644 index 0000000..2ed9dda --- /dev/null +++ b/solutions/alv67/day17/test2.txt @@ -0,0 +1,5 @@ +Register A: 2024 +Register B: 0 +Register C: 0 + +Program: 0,3,5,4,3,0 \ No newline at end of file diff --git a/solutions/alv67/day18/day18.ipynb b/solutions/alv67/day18/day18.ipynb new file mode 100644 index 0000000..33c48eb --- /dev/null +++ b/solutions/alv67/day18/day18.ipynb @@ -0,0 +1,166 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 18: RAM Run ---" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The solution for part 1 is: 304\n", + "The solution for part 2 is: (50, 28)\n" + ] + } + ], + "source": [ + "# --- Part One and Part Two ---\n", + "\n", + "memory = {\"size\": (71,71), \"filename\": \"input.txt\", \"n_falls\": 1024}\n", + "\n", + "#memory = {\"size\": (7,7), \"filename\": \"test.txt\", \"n_falls\": 12} # decomment to test\n", + "\n", + "class Memory:\n", + " def __init__(self, memory: dict):\n", + " self.size = memory[\"size\"]\n", + " self.memory = []\n", + " self._init_memory()\n", + " self.bad_blocks = []\n", + " self.exit_path = []\n", + " self.load_file(memory[\"filename\"])\n", + "\n", + " def _init_memory(self):\n", + " self.memory = [[None for _ in range(self.size[0])] for _ in range(self.size[1])]\n", + " def load_file(self, filename: str):\n", + " with open(filename, 'r') as file:\n", + " #print([(int(x),int(y)) for x, y in [line.strip().split(',') for line in file]])\n", + " self.bad_blocks = [(int(x),int(y)) for x, y in [line.strip().split(',') for line in file]]\n", + " \n", + " def corrupt(self, qty = None):\n", + " self._init_memory()\n", + " if qty: bad_blocks = self.bad_blocks[:qty]\n", + " else: bad_blocks = self.bad_blocks \n", + " for x, y in bad_blocks:\n", + " self.memory[y][x] = \"#\"\n", + " \n", + " def add_corrupt(self, pos):\n", + " x,y = pos\n", + " self.memory[y][x] = \"#\"\n", + "\n", + " def find_path(self,start = (0,0)):\n", + " directions = [(1,0), (0,1), (-1,0), (0, -1)]\n", + " map_cost= {}\n", + " pos = start\n", + " end = (self.size[0]-1,self.size[1]-1)\n", + " map_cost[pos] = 0\n", + " to_check = [pos]\n", + " while to_check:\n", + " p = to_check.pop(0)\n", + " c = map_cost[p]\n", + " for d in directions:\n", + " x, y = (p[0]+d[0], p[1]+d[1])\n", + " if x < 0 or x >= self.size[0] or y < 0 or y >= self.size[1]:\n", + " continue\n", + " if self.memory[y][x]: \n", + " continue\n", + " if (x, y) not in map_cost or map_cost[(x,y)] > c+1:\n", + " map_cost[(x,y)] = c+1\n", + " to_check.append((x,y))\n", + "\n", + " ret = map_cost.get(end, None)\n", + " \n", + " # get exit path\n", + " # exit_path = []\n", + " # to_check = [end]\n", + " # while ret and to_check:\n", + " # p = to_check.pop(0)\n", + " # c = map_cost[p]\n", + " # for d in directions:\n", + " # x, y = (p[0]+d[0], p[1]+d[1])\n", + " # if x < 0 or x >= self.size[0] or y < 0 or y >= self.size[1]:\n", + " # continue\n", + " # if (x, y) in map_cost and map_cost[(x,y)] == c-1:\n", + " # exit_path.append((x,y))\n", + " # to_check.append((x,y))\n", + "\n", + " # self.exit_path = exit_path\n", + " return ret\n", + "\n", + " def __str__(self):\n", + " retstr = \"\"\n", + " for y, row in enumerate(self.memory):\n", + " for x, cell in enumerate(row):\n", + " if cell == \"#\":\n", + " retstr += \"#\"\n", + " elif (x,y) in self.exit_path:\n", + " retstr += \"O\"\n", + " else:\n", + " retstr += \".\"\n", + " retstr += \"\\n\"\n", + " return retstr\n", + "\n", + "# ---- main ------\n", + "\n", + "mem_space = Memory(memory)\n", + "\n", + "mem_space.corrupt(memory[\"n_falls\"])\n", + "# print(mem_space)\n", + "res1 = mem_space.find_path()\n", + "print(f\"The solution for part 1 is: {res1}\")\n", + "\n", + "\n", + "# part 2\n", + "res2 = 0\n", + "bad_blocks = mem_space.bad_blocks\n", + "bb_ok = memory[\"n_falls\"]\n", + "bb_max = len(bad_blocks)\n", + "bb_test = 0\n", + "while bb_max - bb_ok > 1:\n", + " bb_test = bb_ok + (bb_max-bb_ok)//2\n", + " #print(f\"Test with {bb_test} bad blocks\")\n", + " mem_space.corrupt(bb_test)\n", + " ret = mem_space.find_path()\n", + " if ret:\n", + " #print(f\" Path Found\")\n", + " bb_ok = bb_test\n", + " else:\n", + " #print(f\" !! no Path !!\")\n", + " bb_max = bb_test\n", + "#print (f\">>> {bb_ok} <<<< {bad_blocks[bb_ok]}\")\n", + "res2 = bad_blocks[bb_ok]\n", + "\n", + "print(f\"The solution for part 2 is: {res2}\")\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day18/input.txt b/solutions/alv67/day18/input.txt new file mode 100644 index 0000000..54b21a7 --- /dev/null +++ b/solutions/alv67/day18/input.txt @@ -0,0 +1,3450 @@ +2,5 +20,1 +63,59 +21,29 +37,59 +33,63 +14,33 +70,15 +21,34 +62,5 +45,54 +45,60 +48,53 +33,58 +23,35 +22,3 +33,0 +63,62 +44,67 +52,55 +5,19 +42,55 +45,0 +57,3 +15,45 +41,62 +1,39 +63,19 +39,59 +39,3 +48,7 +61,65 +31,1 +54,51 +11,14 +53,62 +67,68 +65,16 +17,45 +21,24 +55,3 +30,15 +4,39 +69,19 +69,57 +41,57 +43,24 +19,11 +18,27 +3,48 +8,13 +41,66 +67,67 +61,62 +5,37 +18,19 +29,64 +13,14 +42,57 +33,67 +0,19 +67,53 +47,59 +19,3 +51,54 +53,69 +42,5 +7,26 +59,65 +50,69 +3,27 +26,9 +43,3 +17,7 +15,11 +12,31 +43,5 +50,65 +9,5 +29,3 +21,6 +65,15 +43,57 +15,37 +50,53 +67,51 +29,1 +47,7 +55,54 +52,51 +47,54 +17,26 +12,43 +65,51 +1,27 +15,22 +63,15 +7,37 +69,49 +57,59 +7,36 +60,7 +66,7 +18,35 +13,36 +21,19 +15,3 +46,9 +30,3 +53,7 +8,7 +66,3 +49,69 +35,65 +48,5 +33,6 +1,31 +26,5 +44,59 +68,13 +45,67 +9,16 +51,55 +57,5 +2,33 +57,64 +31,2 +1,19 +5,12 +19,37 +40,67 +10,19 +21,12 +3,31 +51,1 +4,29 +52,65 +47,5 +17,19 +70,47 +11,19 +57,10 +54,55 +39,53 +61,56 +49,55 +28,37 +21,30 +9,45 +43,69 +57,19 +29,10 +60,63 +19,32 +66,5 +53,45 +53,49 +47,57 +26,1 +17,34 +65,7 +7,28 +41,63 +6,1 +69,69 +0,13 +5,28 +10,1 +38,67 +37,13 +3,7 +39,12 +2,15 +54,65 +35,53 +63,20 +13,30 +52,47 +13,3 +69,55 +55,61 +37,4 +7,35 +57,4 +35,69 +5,3 +63,64 +40,69 +59,5 +32,61 +66,61 +43,64 +40,1 +49,3 +68,65 +3,38 +21,4 +49,56 +18,29 +23,12 +7,11 +16,29 +8,11 +10,25 +39,67 +59,60 +3,19 +26,31 +7,9 +51,58 +49,67 +53,65 +65,59 +67,9 +43,58 +55,51 +69,7 +6,39 +49,59 +10,37 +4,43 +54,5 +3,28 +69,16 +67,7 +4,37 +37,1 +27,2 +62,59 +45,70 +25,35 +65,53 +31,7 +53,59 +1,10 +67,10 +65,67 +30,67 +17,1 +67,59 +31,61 +59,59 +65,69 +51,59 +61,66 +13,15 +29,65 +27,1 +65,65 +68,53 +53,11 +5,17 +20,35 +43,68 +3,30 +59,7 +3,39 +45,63 +7,31 +3,13 +51,5 +23,39 +20,3 +67,0 +37,3 +46,61 +65,70 +15,1 +17,11 +66,63 +32,23 +51,0 +3,1 +17,3 +13,6 +59,3 +19,31 +1,24 +41,3 +4,49 +40,57 +63,6 +16,17 +22,25 +39,60 +11,34 +56,7 +38,57 +55,53 +35,66 +1,11 +64,19 +50,3 +9,38 +19,8 +64,61 +3,17 +8,33 +13,1 +5,9 +50,7 +1,34 +41,65 +48,57 +14,13 +17,31 +56,1 +6,15 +24,25 +23,2 +69,13 +45,52 +15,23 +15,27 +27,28 +60,3 +31,30 +19,35 +42,53 +19,27 +61,1 +65,50 +53,2 +52,61 +15,20 +42,7 +67,20 +11,23 +29,54 +6,17 +41,53 +47,63 +68,51 +21,21 +19,6 +53,61 +23,29 +53,9 +19,29 +21,10 +2,41 +10,3 +49,9 +42,59 +12,1 +45,7 +19,28 +3,35 +69,6 +43,4 +17,21 +47,3 +52,7 +65,22 +45,62 +16,5 +51,3 +48,11 +7,33 +40,3 +26,35 +37,63 +49,68 +11,26 +54,67 +64,23 +21,17 +5,49 +63,65 +23,13 +58,1 +61,54 +69,56 +47,60 +11,7 +9,35 +57,58 +45,66 +1,23 +7,21 +17,12 +11,17 +34,3 +25,25 +22,35 +57,65 +17,17 +1,5 +12,33 +36,63 +19,15 +7,38 +53,55 +21,25 +42,1 +17,23 +35,67 +33,3 +56,63 +56,59 +3,2 +42,67 +65,56 +45,5 +5,33 +21,22 +9,42 +3,14 +21,14 +59,53 +64,53 +33,25 +11,35 +9,1 +63,16 +47,49 +53,60 +47,55 +39,1 +63,60 +35,63 +9,31 +55,68 +57,57 +68,15 +11,39 +62,69 +41,45 +55,57 +5,13 +9,14 +1,32 +17,5 +19,19 +19,30 +1,29 +55,56 +6,35 +21,8 +13,0 +4,25 +16,33 +69,9 +53,67 +67,17 +52,67 +41,59 +24,1 +51,7 +54,7 +3,22 +7,13 +41,61 +45,3 +21,33 +37,53 +11,13 +45,8 +48,1 +43,13 +17,46 +1,33 +41,69 +22,19 +19,38 +19,12 +45,57 +53,6 +15,36 +35,68 +9,21 +43,65 +5,41 +7,7 +68,61 +60,1 +7,23 +21,28 +23,34 +63,69 +7,40 +51,64 +66,51 +43,61 +49,63 +69,11 +50,51 +53,13 +17,24 +47,65 +32,67 +4,15 +38,1 +58,63 +23,21 +61,59 +15,21 +11,27 +33,65 +2,1 +20,25 +11,3 +55,67 +5,31 +43,53 +63,66 +3,29 +65,55 +36,69 +64,1 +3,23 +11,6 +52,57 +61,4 +63,17 +61,69 +3,33 +65,4 +21,16 +27,11 +1,3 +5,39 +69,54 +63,47 +1,36 +27,27 +33,61 +25,37 +61,14 +15,26 +55,1 +7,17 +29,11 +11,12 +2,19 +66,55 +45,59 +29,29 +26,39 +8,17 +45,65 +11,37 +2,39 +0,29 +5,27 +16,31 +67,65 +68,63 +26,25 +9,30 +3,36 +48,65 +59,51 +63,1 +7,41 +23,28 +1,15 +18,1 +4,41 +43,63 +21,27 +67,22 +52,69 +7,18 +68,49 +3,12 +18,17 +9,41 +19,13 +1,17 +3,26 +59,61 +57,66 +53,63 +39,69 +3,3 +67,69 +50,57 +9,19 +1,13 +55,58 +49,6 +7,3 +47,1 +12,37 +59,63 +61,67 +8,45 +41,1 +8,1 +39,63 +8,27 +15,19 +1,25 +61,57 +47,66 +46,5 +0,39 +4,3 +67,8 +9,43 +64,67 +49,47 +63,14 +51,57 +0,47 +8,3 +21,15 +63,57 +46,3 +5,21 +15,31 +57,12 +13,18 +21,23 +67,15 +21,7 +23,14 +67,55 +63,63 +21,13 +67,58 +51,49 +25,26 +2,31 +56,51 +32,69 +55,7 +31,62 +65,57 +55,65 +5,24 +7,20 +11,15 +19,14 +65,21 +5,1 +67,5 +67,63 +67,49 +68,57 +19,21 +37,65 +11,1 +47,61 +33,7 +28,3 +12,21 +47,68 +41,70 +65,1 +69,23 +5,25 +47,11 +49,61 +1,35 +59,57 +1,37 +33,1 +53,57 +59,1 +49,65 +27,15 +60,11 +61,63 +5,34 +69,15 +9,20 +66,65 +49,62 +35,3 +55,5 +4,19 +21,20 +47,67 +59,68 +24,27 +41,5 +67,3 +21,3 +47,9 +65,17 +9,47 +23,3 +41,67 +65,63 +15,29 +55,49 +3,6 +69,17 +22,17 +48,51 +33,64 +51,65 +9,27 +58,55 +25,21 +69,24 +9,22 +64,63 +19,1 +9,36 +17,27 +54,49 +38,69 +8,5 +46,67 +60,57 +68,11 +0,7 +19,17 +39,65 +27,3 +9,40 +64,57 +17,25 +3,25 +19,9 +47,8 +58,61 +23,22 +21,11 +41,7 +18,9 +11,45 +51,67 +52,3 +8,43 +9,25 +69,8 +67,11 +2,27 +63,51 +65,61 +53,5 +7,19 +18,3 +67,18 +45,9 +55,63 +15,15 +47,64 +54,3 +13,31 +19,5 +41,64 +15,16 +37,67 +53,52 +12,9 +15,4 +25,34 +43,59 +2,17 +23,33 +57,8 +16,15 +57,67 +29,0 +66,69 +19,7 +42,61 +66,15 +67,61 +51,63 +36,7 +1,16 +2,23 +66,59 +67,2 +61,64 +56,65 +56,5 +15,2 +19,33 +15,28 +49,53 +5,35 +12,3 +65,18 +69,53 +11,33 +37,2 +47,69 +57,69 +11,5 +34,7 +3,45 +63,5 +15,33 +35,1 +17,20 +23,11 +6,31 +17,35 +50,61 +51,4 +64,3 +62,55 +3,9 +49,60 +13,35 +68,69 +21,37 +44,63 +2,9 +15,7 +49,5 +67,13 +9,39 +9,33 +9,24 +2,11 +5,23 +46,55 +17,22 +9,23 +48,3 +45,13 +47,58 +60,59 +5,18 +14,3 +24,11 +56,69 +43,55 +57,63 +55,10 +17,33 +53,47 +36,3 +13,16 +5,32 +64,7 +32,3 +51,51 +10,17 +13,37 +40,59 +11,31 +13,19 +19,10 +49,1 +34,1 +10,27 +42,9 +61,2 +58,57 +13,33 +25,3 +43,2 +23,31 +24,37 +59,66 +12,29 +7,10 +31,65 +19,23 +39,64 +22,39 +18,5 +55,62 +23,18 +39,62 +53,50 +21,31 +40,55 +58,5 +23,40 +67,66 +69,59 +23,25 +39,61 +1,7 +21,1 +21,5 +57,61 +51,53 +53,51 +5,29 +69,47 +30,27 +5,14 +10,45 +18,23 +7,29 +55,60 +40,7 +49,7 +14,31 +15,25 +68,19 +57,49 +12,23 +7,30 +60,49 +50,9 +16,1 +22,9 +57,55 +15,24 +65,49 +69,25 +59,69 +28,69 +4,21 +23,36 +58,69 +69,61 +23,8 +5,8 +43,1 +9,37 +55,69 +3,11 +66,53 +70,59 +14,19 +15,17 +9,13 +59,55 +36,65 +69,67 +8,23 +23,32 +3,8 +65,3 +69,65 +29,5 +9,15 +61,61 +13,34 +1,1 +3,4 +68,45 +45,56 +33,69 +67,48 +38,65 +6,21 +0,3 +63,68 +50,67 +15,13 +63,58 +9,34 +67,1 +48,63 +60,69 +69,51 +57,47 +70,67 +51,47 +59,54 +57,7 +43,67 +4,45 +59,67 +45,2 +67,57 +62,1 +69,52 +31,63 +69,21 +31,15 +27,9 +3,37 +19,25 +63,55 +6,3 +53,3 +20,21 +13,17 +23,30 +6,23 +43,7 +17,29 +57,2 +21,32 +51,69 +7,1 +44,5 +57,1 +33,66 +45,69 +59,8 +9,3 +13,23 +11,22 +65,5 +1,9 +24,17 +61,3 +49,57 +12,19 +13,28 +69,12 +10,51 +53,53 +13,47 +31,69 +24,43 +69,63 +20,17 +67,21 +44,55 +33,68 +7,15 +45,1 +39,55 +39,4 +69,60 +23,27 +45,61 +51,61 +25,1 +63,3 +37,69 +33,5 +17,15 +9,32 +7,39 +63,54 +65,47 +29,19 +53,43 +60,33 +57,45 +5,6 +47,27 +39,25 +48,47 +53,36 +43,18 +49,21 +41,21 +23,19 +52,35 +39,45 +55,17 +29,39 +57,51 +55,45 +54,27 +33,26 +40,19 +44,17 +57,20 +37,45 +27,64 +31,13 +41,13 +5,7 +9,57 +10,69 +23,47 +1,51 +0,69 +49,12 +3,58 +15,9 +21,53 +53,27 +45,11 +63,42 +27,56 +6,11 +27,12 +27,31 +23,41 +35,41 +15,61 +61,27 +21,43 +41,43 +17,56 +11,66 +41,28 +51,37 +41,27 +38,59 +39,47 +59,41 +11,41 +26,59 +59,16 +29,35 +1,45 +33,41 +55,29 +65,39 +47,50 +28,5 +39,43 +35,21 +54,25 +43,16 +51,43 +31,17 +23,53 +37,21 +43,22 +22,55 +57,17 +15,49 +36,57 +11,48 +56,27 +36,39 +53,35 +8,51 +29,46 +61,29 +67,37 +31,35 +42,47 +63,41 +37,18 +43,36 +52,21 +63,9 +57,48 +29,36 +39,27 +35,59 +55,41 +25,53 +45,47 +19,66 +29,44 +61,5 +49,23 +14,59 +27,59 +19,58 +16,13 +44,51 +29,24 +13,7 +26,19 +37,20 +41,40 +28,27 +65,38 +41,47 +47,19 +49,49 +46,39 +38,55 +13,65 +53,44 +31,49 +36,5 +68,5 +42,45 +3,5 +4,63 +59,23 +23,56 +15,59 +37,52 +67,35 +11,11 +1,63 +11,25 +19,47 +31,33 +61,36 +27,46 +35,44 +46,21 +9,56 +5,59 +27,41 +35,37 +28,13 +39,20 +61,23 +36,15 +35,9 +7,8 +52,15 +14,39 +51,21 +65,25 +35,12 +58,15 +66,35 +23,7 +35,62 +63,25 +68,1 +23,64 +68,33 +65,28 +44,29 +19,67 +29,43 +47,51 +25,67 +2,45 +55,21 +37,43 +32,21 +58,51 +69,33 +13,29 +41,11 +47,23 +65,35 +23,45 +31,64 +41,50 +1,65 +25,39 +42,39 +44,47 +67,39 +32,35 +43,38 +51,29 +9,6 +41,24 +3,67 +57,31 +41,44 +53,19 +19,41 +14,61 +15,41 +46,49 +39,35 +62,51 +51,23 +32,9 +23,60 +1,47 +49,27 +57,36 +19,52 +43,49 +49,35 +21,50 +49,39 +53,38 +51,19 +21,57 +43,45 +33,38 +45,41 +1,56 +39,22 +21,63 +48,49 +47,30 +37,39 +4,61 +34,13 +26,51 +47,39 +19,45 +31,59 +3,52 +17,54 +69,45 +15,35 +49,11 +17,69 +55,13 +64,39 +57,33 +45,40 +28,21 +11,9 +64,29 +33,19 +21,60 +32,19 +47,25 +57,53 +31,4 +17,61 +69,5 +19,39 +46,15 +60,51 +9,50 +27,40 +63,29 +59,36 +11,55 +25,61 +30,55 +35,25 +27,69 +23,1 +9,65 +43,37 +27,42 +19,49 +56,45 +13,49 +35,7 +33,47 +43,11 +38,33 +35,49 +63,39 +41,20 +13,48 +1,60 +43,30 +7,45 +55,19 +65,19 +53,15 +33,53 +29,49 +51,45 +13,50 +34,23 +20,55 +10,11 +12,39 +17,53 +11,65 +27,37 +8,53 +65,24 +65,45 +61,45 +7,65 +59,37 +27,21 +39,39 +31,67 +45,23 +53,10 +59,22 +25,42 +1,57 +54,45 +13,10 +43,23 +37,51 +51,13 +40,35 +48,45 +36,27 +1,59 +39,51 +57,32 +31,5 +35,5 +8,69 +25,29 +39,9 +19,53 +29,40 +61,43 +7,62 +39,17 +3,54 +27,57 +67,43 +23,49 +53,17 +29,47 +25,41 +9,62 +61,35 +27,38 +23,9 +67,38 +41,49 +22,45 +43,15 +25,17 +13,69 +31,52 +29,68 +29,37 +30,37 +7,63 +37,27 +55,39 +65,13 +50,23 +59,11 +25,11 +25,65 +26,15 +55,37 +47,18 +20,69 +12,69 +8,47 +61,17 +53,12 +54,41 +9,69 +33,59 +57,37 +47,47 +61,39 +40,13 +69,3 +18,55 +22,47 +65,41 +31,45 +21,9 +38,27 +61,30 +61,55 +3,57 +51,11 +20,57 +41,51 +61,15 +40,37 +53,23 +49,38 +22,69 +1,61 +16,59 +20,65 +17,63 +51,17 +26,45 +24,31 +61,49 +38,41 +22,51 +29,16 +11,52 +34,35 +30,61 +37,33 +58,19 +9,29 +29,17 +61,9 +2,51 +7,59 +49,51 +35,55 +8,59 +29,41 +37,47 +23,67 +30,53 +15,69 +33,27 +49,31 +69,29 +59,43 +3,41 +43,10 +59,19 +35,27 +61,11 +27,25 +49,30 +28,57 +15,53 +39,29 +45,46 +16,41 +28,9 +27,61 +37,15 +29,18 +15,47 +17,57 +25,19 +37,25 +11,64 +45,12 +61,46 +14,67 +6,51 +19,65 +32,17 +21,65 +46,29 +51,28 +25,6 +19,51 +35,61 +47,41 +45,45 +39,49 +36,25 +19,59 +32,25 +25,47 +30,41 +62,19 +39,50 +41,41 +44,43 +53,37 +33,14 +40,51 +62,47 +19,48 +55,43 +63,13 +68,43 +65,29 +53,25 +23,59 +39,11 +54,17 +59,35 +63,53 +13,11 +35,58 +12,5 +63,21 +25,20 +45,37 +34,47 +24,55 +3,53 +11,67 +46,33 +25,31 +56,23 +36,43 +8,65 +61,19 +37,41 +41,31 +31,27 +37,23 +64,49 +6,67 +9,17 +11,40 +17,13 +26,11 +67,41 +23,57 +13,52 +50,17 +21,35 +33,51 +59,40 +27,5 +36,33 +3,62 +35,60 +58,43 +13,56 +24,67 +17,37 +29,53 +63,23 +20,51 +24,39 +13,12 +2,55 +62,41 +28,49 +39,44 +20,47 +52,27 +35,39 +59,25 +35,32 +49,29 +65,31 +35,52 +54,47 +29,51 +37,9 +13,13 +53,31 +45,39 +9,7 +39,13 +17,65 +37,31 +24,5 +30,5 +2,65 +28,7 +49,17 +55,55 +37,24 +13,5 +3,68 +49,13 +56,15 +21,49 +41,37 +43,26 +57,25 +3,47 +29,21 +47,43 +29,42 +55,11 +35,19 +6,55 +53,34 +23,17 +31,12 +4,69 +15,43 +66,33 +59,33 +13,57 +17,42 +10,67 +59,13 +50,37 +33,45 +35,40 +38,7 +21,41 +9,63 +53,1 +33,37 +13,66 +50,15 +1,55 +19,36 +18,47 +61,26 +49,25 +59,38 +5,43 +37,62 +11,61 +22,67 +61,18 +33,55 +18,61 +25,9 +62,49 +56,29 +65,44 +59,29 +33,39 +55,9 +49,37 +13,55 +35,22 +41,39 +48,19 +30,21 +13,9 +21,39 +37,61 +29,15 +27,52 +19,55 +47,35 +51,33 +8,55 +63,7 +35,46 +11,54 +29,69 +15,52 +31,46 +25,62 +63,43 +41,26 +61,41 +7,64 +43,35 +47,33 +40,33 +45,36 +57,41 +57,23 +57,27 +11,29 +5,69 +63,37 +7,25 +34,9 +57,24 +23,5 +59,18 +23,55 +48,41 +11,47 +16,57 +60,25 +60,23 +20,53 +66,47 +56,33 +30,11 +15,46 +26,33 +64,33 +51,10 +35,13 +5,55 +33,21 +10,55 +35,11 +9,53 +23,44 +63,11 +69,1 +21,45 +6,47 +42,17 +32,41 +17,49 +61,12 +35,45 +31,51 +55,20 +31,25 +7,51 +41,15 +45,31 +31,8 +29,13 +3,43 +27,70 +59,21 +43,41 +67,45 +59,46 +56,43 +5,66 +18,39 +39,10 +1,22 +68,25 +15,48 +68,41 +2,67 +37,46 +15,44 +25,69 +43,47 +61,28 +61,31 +43,20 +48,37 +19,44 +24,9 +27,16 +37,29 +51,40 +38,25 +62,31 +31,23 +47,21 +13,53 +12,61 +37,8 +5,47 +17,67 +49,44 +31,19 +25,57 +13,67 +3,65 +63,8 +3,69 +29,63 +11,63 +27,60 +31,37 +29,61 +25,27 +32,13 +1,53 +52,31 +57,35 +36,35 +67,32 +33,30 +4,57 +23,43 +39,31 +46,47 +5,61 +43,51 +51,9 +10,43 +5,63 +69,41 +7,60 +53,21 +45,35 +34,25 +37,35 +33,40 +64,9 +37,7 +9,49 +13,59 +70,43 +11,46 +43,34 +36,49 +29,9 +46,13 +31,38 +41,23 +65,33 +47,28 +54,37 +23,58 +33,33 +1,43 +7,67 +6,43 +63,33 +27,17 +49,41 +15,40 +43,21 +50,1 +61,21 +5,5 +51,48 +37,10 +44,49 +1,64 +55,31 +13,54 +47,31 +31,57 +45,49 +57,50 +52,25 +48,33 +61,13 +27,29 +31,28 +19,69 +23,15 +45,20 +65,42 +24,63 +55,47 +61,20 +40,29 +45,55 +11,59 +48,35 +25,5 +33,29 +15,10 +59,44 +41,29 +24,23 +43,27 +69,31 +37,38 +45,15 +51,15 +65,11 +5,46 +41,33 +62,37 +62,35 +53,20 +59,31 +9,67 +31,44 +46,37 +22,59 +27,19 +41,16 +25,4 +11,8 +31,9 +16,7 +28,61 +49,45 +45,21 +57,15 +50,25 +30,7 +14,69 +43,14 +33,49 +42,33 +67,36 +21,62 +51,38 +37,49 +62,9 +58,13 +35,43 +1,49 +57,46 +25,43 +5,67 +31,53 +59,9 +8,67 +13,63 +43,32 +33,42 +30,49 +0,63 +1,50 +21,59 +19,63 +36,55 +23,37 +67,27 +10,61 +5,56 +31,31 +47,13 +20,45 +28,31 +1,67 +15,62 +34,19 +55,40 +62,23 +2,47 +67,31 +39,5 +7,57 +15,70 +33,57 +28,53 +55,27 +7,5 +66,25 +47,22 +11,51 +23,51 +53,28 +61,33 +23,69 +65,37 +11,53 +31,3 +64,45 +7,69 +13,42 +31,34 +4,65 +68,21 +55,15 +41,55 +15,56 +39,33 +45,34 +25,15 +19,61 +21,67 +37,48 +24,53 +7,49 +37,30 +43,31 +5,15 +37,36 +31,41 +27,65 +25,13 +0,53 +37,57 +45,43 +15,65 +25,45 +33,48 +15,42 +15,38 +45,51 +3,55 +29,7 +39,23 +13,39 +20,63 +31,56 +45,27 +64,31 +27,39 +33,16 +25,14 +61,25 +21,55 +55,23 +43,39 +18,65 +15,67 +43,9 +30,59 +26,29 +41,17 +60,15 +25,23 +57,9 +24,15 +10,57 +17,59 +65,27 +52,45 +58,29 +70,31 +15,39 +55,35 +43,33 +17,55 +29,45 +55,14 +9,59 +53,16 +31,43 +15,5 +17,43 +62,43 +17,47 +59,28 +10,29 +67,29 +61,37 +69,36 +22,53 +43,43 +29,57 +48,15 +29,67 +61,47 +33,35 +51,31 +35,23 +27,13 +34,55 +27,18 +25,49 +25,63 +34,37 +39,38 +60,39 +55,25 +31,32 +53,39 +37,17 +39,21 +33,50 +68,27 +50,47 +26,53 +56,41 +15,51 +51,42 +11,43 +21,47 +35,33 +50,41 +31,11 +45,32 +31,29 +33,28 +15,57 +69,28 +23,63 +35,47 +55,22 +29,27 +29,59 +62,15 +27,67 +13,43 +53,24 +6,5 +29,50 +44,41 +10,63 +36,37 +1,58 +59,27 +39,37 +26,23 +25,33 +39,16 +15,50 +60,21 +3,63 +45,19 +46,41 +42,11 +5,57 +5,45 +4,53 +42,49 +49,33 +10,59 +21,69 +3,61 +30,19 +28,33 +21,42 +30,23 +69,37 +16,37 +33,17 +65,23 +38,53 +54,13 +43,19 +16,9 +34,61 +70,3 +38,49 +39,7 +37,42 +31,47 +15,54 +70,41 +50,21 +15,55 +61,44 +47,29 +54,9 +13,24 +18,69 +25,55 +45,10 +17,51 +52,13 +3,59 +27,53 +22,43 +45,25 +5,53 +39,19 +32,7 +13,51 +33,11 +13,61 +33,15 +59,39 +54,31 +63,31 +30,33 +50,35 +28,29 +22,65 +14,7 +13,64 +13,41 +35,30 +37,14 +27,63 +21,51 +23,23 +57,26 +66,29 +29,48 +35,50 +27,49 +51,35 +13,45 +69,35 +27,44 +13,27 +20,61 +37,19 +2,61 +33,9 +53,32 +61,53 +65,43 +44,13 +51,39 +35,17 +24,47 +27,55 +56,53 +31,36 +50,45 +51,30 +17,68 +29,33 +59,48 +47,45 +34,53 +41,19 +42,29 +45,44 +7,43 +63,45 +34,17 +51,25 +3,51 +37,12 +29,31 +3,42 +63,61 +66,13 +7,48 +27,43 +61,32 +59,49 +15,63 +3,15 +40,47 +35,31 +29,55 +26,57 +1,69 +65,10 +5,11 +24,21 +57,21 +41,25 +38,15 +37,5 +51,27 +41,30 +11,57 +63,26 +67,25 +29,23 +39,18 +17,39 +52,41 +57,39 +51,41 +25,50 +21,61 +35,15 +9,51 +69,30 +56,39 +49,20 +61,51 +27,23 +25,51 +49,16 +67,19 +63,35 +17,41 +56,17 +65,46 +63,40 +6,53 +37,28 +7,47 +32,53 +47,37 +59,45 +70,21 +49,32 +25,7 +26,67 +25,60 +65,26 +59,17 +9,55 +6,45 +11,21 +18,13 +25,68 +39,40 +11,50 +67,46 +45,33 +37,54 +7,58 +35,29 +55,33 +29,14 +23,61 +21,38 +57,11 +15,66 +38,45 +25,59 +40,43 +37,37 +51,18 +67,47 +18,51 +56,35 +49,43 +7,27 +13,44 +46,17 +31,39 +27,33 +5,51 +13,46 +68,39 +61,7 +39,26 +45,53 +43,29 +34,33 +39,15 +7,53 +33,44 +69,39 +62,11 +23,65 +59,15 +41,42 +55,59 +27,7 +50,33 +69,43 +32,59 +58,23 +29,58 +41,36 +49,24 +45,17 +55,34 +33,31 +16,61 +7,55 +31,21 +23,48 +46,45 +6,63 +41,14 +4,59 +35,57 +59,47 +49,28 +57,38 +63,27 +41,22 +13,21 +5,50 +47,26 +57,43 +53,22 +36,17 +57,13 +9,61 +66,39 +55,30 +16,67 +46,25 +13,25 +43,17 +9,11 +53,33 +35,20 +37,55 +58,33 +10,9 +44,23 +45,29 +33,10 +37,11 +63,67 +1,41 +64,35 +33,23 +19,43 +53,29 +47,17 +31,55 +13,58 +33,13 +59,42 +6,69 +43,25 +11,69 +47,15 +41,9 +25,64 +27,47 +47,42 +17,64 +47,53 +17,9 +20,67 +18,59 +13,26 +53,41 +29,26 +59,30 +33,56 +44,27 +26,47 +27,66 +3,21 +49,26 +29,66 +12,59 +41,35 +25,48 +33,32 +27,35 +39,57 +15,64 +37,22 +39,6 +5,65 +11,49 +65,9 +29,25 +49,15 +9,9 +66,41 +55,18 +41,52 +38,31 +59,52 +69,34 +27,51 +27,45 +59,10 +3,49 +29,22 +7,61 +35,35 +32,49 +67,33 +63,48 +20,41 +19,40 +1,21 +1,44 +57,29 +64,13 +49,14 +17,44 +40,9 +19,57 +69,27 +67,23 +63,49 +62,25 +47,24 +17,50 +35,51 +50,11 +32,47 +33,43 +49,19 +39,41 +67,30 +61,34 +43,60 +12,46 +70,22 +38,20 +14,44 +41,38 +22,52 +12,67 +2,7 +58,46 +34,30 +34,70 +6,46 +20,68 +7,24 +9,18 +33,20 +60,42 +67,24 +37,6 +0,61 +12,18 +20,10 +39,54 +69,0 +16,65 +40,63 +14,10 +34,21 +54,56 +16,21 +62,12 +23,24 +48,61 +70,29 +30,16 +0,66 +70,6 +6,52 +30,62 +35,14 +62,36 +48,58 +13,8 +28,60 +22,26 +66,17 +62,54 +40,53 +12,53 +23,54 +61,40 +43,66 +0,34 +15,68 +32,66 +22,10 +42,48 +28,6 +38,38 +55,28 +46,23 +16,68 +52,54 +5,52 +4,64 +57,42 +2,49 +38,12 +64,38 +28,52 +68,31 +68,52 +21,70 +16,16 +8,31 +9,66 +4,55 +11,68 +36,14 +42,16 +32,39 +54,64 +18,58 +52,46 +68,22 +7,0 +29,62 +0,44 +35,8 +18,67 +23,52 +58,42 +26,2 +32,57 +8,66 +30,20 +0,30 +12,6 +46,1 +49,2 +34,56 +16,52 +2,2 +48,24 +25,38 +41,34 +46,28 +32,26 +53,48 +34,69 +11,28 +3,64 +62,8 +12,48 +19,22 +4,11 +24,30 +22,31 +32,45 +19,68 +12,60 +7,32 +22,38 +25,58 +55,42 +47,70 +18,28 +66,62 +34,41 +44,57 +4,10 +53,64 +38,34 +12,22 +37,70 +0,42 +30,31 +35,54 +61,48 +58,34 +36,38 +66,43 +54,52 +39,66 +43,62 +60,52 +37,44 +42,22 +53,0 +70,25 +18,40 +69,20 +53,58 +21,18 +25,12 +0,67 +25,44 +22,14 +48,32 +48,38 +18,15 +52,30 +34,15 +52,43 +52,52 +46,63 +2,22 +10,21 +22,64 +37,58 +10,31 +21,64 +6,40 +0,58 +36,42 +24,2 +65,20 +0,1 +2,58 +21,26 +0,68 +62,26 +8,32 +38,17 +11,56 +19,18 +31,20 +43,70 +0,5 +3,10 +14,38 +14,37 +32,33 +18,44 +62,53 +6,29 +70,30 +42,21 +18,37 +23,38 +14,60 +46,59 +34,22 +10,48 +8,63 +68,20 +50,58 +44,32 +4,67 +40,14 +22,34 +6,25 +38,52 +38,48 +32,30 +38,54 +26,49 +5,30 +34,48 +45,28 +56,58 +17,60 +10,38 +44,70 +24,49 +7,12 +42,38 +38,13 +52,48 +40,2 +52,59 +20,52 +21,68 +44,44 +2,70 +10,6 +24,52 +40,48 +48,20 +70,20 +36,23 +36,58 +20,27 +58,4 +2,8 +26,38 +4,38 +36,60 +12,57 +34,49 +30,29 +48,50 +18,60 +22,21 +64,62 +31,50 +20,37 +20,33 +5,40 +34,46 +12,12 +17,32 +2,29 +44,28 +58,45 +32,63 +54,30 +12,42 +16,28 +8,16 +66,42 +12,49 +12,63 +26,68 +18,25 +44,21 +17,6 +34,34 +36,67 +2,13 +26,3 +70,0 +39,58 +17,14 +18,12 +43,50 +16,25 +2,34 +8,50 +62,6 +26,41 +50,40 +30,56 +18,49 +4,32 +16,60 +22,8 +15,6 +21,36 +4,58 +29,28 +47,40 +36,62 +34,14 +33,60 +8,44 +43,8 +60,55 +39,30 +24,24 +36,11 +47,48 +38,32 +22,58 +31,10 +38,60 +16,46 +10,5 +23,50 +0,14 +4,60 +10,64 +20,22 +66,37 +28,51 +27,26 +38,21 +30,43 +19,20 +0,28 +16,54 +40,46 +34,5 +56,42 +8,34 +41,68 +61,8 +50,63 +27,14 +36,8 +26,36 +30,70 +36,20 +70,33 +41,2 +70,19 +5,22 +38,10 +10,40 +28,42 +42,41 +46,42 +0,23 +70,46 +24,40 +16,39 +38,56 +26,50 +22,5 +40,56 +34,57 +52,64 +46,70 +8,26 +3,34 +32,52 +70,44 +12,24 +8,10 +28,50 +14,16 +20,56 +9,60 +8,20 +37,34 +49,22 +27,24 +17,10 +68,30 +22,62 +22,15 +58,35 +69,44 +14,20 +48,22 +48,25 +51,2 +26,21 +6,30 +12,26 +33,12 +5,60 +60,56 +0,70 +4,56 +56,50 +58,47 +46,0 +50,22 +52,68 +4,4 +32,36 +34,60 +30,17 +36,56 +62,42 +28,23 +3,50 +35,28 +39,34 +38,3 +30,12 +20,7 +18,57 +52,60 +6,50 +52,49 +4,13 +56,56 +8,70 +44,8 +70,1 +28,62 +42,42 +60,12 +50,28 +47,38 +60,43 +50,54 +51,50 +55,12 +31,18 +47,32 +18,16 +16,6 +62,32 +24,69 +2,54 +62,27 +40,32 +38,68 +8,36 +59,70 +52,16 +68,37 +24,18 +53,8 +14,70 +31,60 +32,4 +33,36 +64,14 +52,22 +31,22 +12,51 +16,38 +30,1 +48,40 +57,56 +69,40 +25,32 +50,60 +49,4 +30,64 +46,22 +28,48 +42,56 +2,43 +46,6 +6,41 +43,46 +20,59 +54,6 +58,64 +0,59 +41,10 +54,42 +62,63 +30,57 +4,17 +22,40 +60,44 +52,42 +28,30 +7,2 +0,15 +22,27 +70,38 +30,68 +5,64 +35,38 +0,20 +17,62 +55,70 +5,4 +56,60 +34,42 +60,61 +40,27 +38,44 +5,16 +14,51 +18,26 +46,46 +69,26 +48,14 +32,43 +10,28 +27,22 +54,20 +14,48 +67,26 +57,0 +4,70 +59,12 +51,6 +40,10 +59,20 +32,8 +34,2 +20,18 +62,44 +64,46 +20,58 +56,31 +54,69 +28,14 +0,17 +22,12 +52,0 +20,44 +34,8 +32,29 +65,30 +56,3 +26,52 +4,47 +22,1 +13,38 +62,65 +0,31 +44,42 +42,15 +42,10 +24,38 +10,62 +26,64 +48,64 +48,21 +43,56 +8,46 +4,7 +9,0 +30,14 +56,61 +68,34 +56,55 +13,40 +50,62 +8,2 +50,39 +18,68 +0,37 +4,5 +47,36 +14,24 +44,58 +56,25 +24,62 +6,13 +11,2 +20,5 +18,11 +51,16 +56,6 +53,70 +32,0 +34,51 +37,56 +18,41 +42,70 +24,20 +22,44 +28,46 +20,38 +36,34 +10,56 +43,44 +0,60 +1,70 +37,0 +58,12 +68,17 +66,14 +70,40 +61,58 +53,40 +60,19 +14,4 +3,20 +6,38 +53,18 +24,8 +14,43 +42,43 +50,4 +57,30 +7,50 +37,40 +64,65 +36,47 +66,34 +16,27 +70,34 +20,14 +60,27 +32,31 +66,48 +43,28 +64,28 +67,54 +13,70 +50,38 +42,58 +52,26 +24,29 +20,48 +17,30 +66,67 +68,64 +68,9 +14,68 +70,24 +38,5 +60,47 +11,60 +67,12 +0,43 +1,12 +56,16 +38,22 +24,68 +51,8 +38,63 +60,22 +36,54 +38,61 +66,45 +46,27 +48,8 +6,0 +27,30 +8,40 +32,60 +5,62 +62,67 +64,32 +52,37 +60,5 +70,64 +10,18 +63,52 +18,20 +34,39 +1,62 +51,34 +40,49 +28,38 +51,62 +8,54 +45,58 +5,10 +12,15 +68,8 +26,22 +35,34 +58,32 +32,34 +10,10 +6,7 +38,42 +62,57 +52,6 +40,22 +62,70 +58,6 +50,48 +41,46 +52,18 +60,2 +25,70 +5,0 +50,6 +39,2 +2,4 +62,45 +48,23 +57,34 +55,66 +18,14 +9,52 +24,22 +54,60 +49,52 +12,54 +54,14 +63,44 +56,64 +4,0 +20,50 +18,64 +1,18 +14,41 +16,35 +29,2 +66,52 +12,50 +42,68 +34,24 +56,57 +66,32 +57,60 +28,8 +22,66 +32,32 +52,58 +50,42 +4,36 +16,32 +65,58 +56,20 +42,0 +17,4 +34,68 +49,36 +32,58 +68,50 +19,16 +6,70 +40,38 +60,37 +50,49 +34,40 +51,70 +1,38 +13,32 +53,66 +6,32 +65,32 +32,22 +14,55 +38,30 +44,26 +66,8 +50,30 +48,31 +5,36 +52,19 +29,30 +24,50 +55,36 +46,69 +64,18 +44,0 +27,10 +68,32 +60,13 +12,17 +10,34 +18,18 +70,52 +10,8 +12,38 +16,70 +8,9 +58,65 +64,21 +70,4 +5,48 +22,49 +36,2 +18,30 +41,6 +10,44 +48,48 +60,14 +23,42 +46,36 +18,56 +40,18 +36,40 +24,59 +64,64 +40,11 +59,50 +14,57 +25,46 +65,0 +32,16 +24,4 +40,34 +50,36 +38,50 +20,30 +66,38 +14,40 +70,62 +6,58 +12,28 +62,60 +68,28 +36,29 +58,37 +45,68 +22,22 +40,65 +49,64 +24,65 +40,8 +0,12 +40,64 +70,66 +23,62 +66,49 +28,32 +47,44 +10,12 +29,8 +26,18 +28,16 +49,50 +7,6 +30,54 +52,10 +32,10 +1,0 +40,28 +7,52 +18,54 +5,42 +58,10 +54,40 +41,4 +10,22 +24,56 +44,36 +39,14 +12,2 +65,48 +20,16 +10,4 +56,66 +40,68 +16,19 +45,42 +20,43 +50,18 +40,15 +0,6 +18,62 +14,2 +51,44 +35,48 +54,68 +7,4 +30,25 +27,36 +48,9 +42,46 +57,54 +68,55 +34,59 +58,16 +70,65 +70,14 +24,12 +46,12 +30,39 +55,2 +38,8 +62,22 +3,70 +60,40 +7,44 +9,44 +16,58 +64,2 +22,46 +40,45 +23,0 +62,30 +46,18 +23,6 +27,48 +31,66 +66,30 +52,9 +29,20 +36,21 +69,10 +24,41 +8,38 +44,34 +37,66 +68,4 +34,28 +21,44 +28,70 +42,30 +35,42 +46,16 +6,8 +36,48 +8,61 +14,26 +62,0 +28,45 +46,7 +7,68 +32,40 +61,24 +32,1 +40,12 +58,2 +62,58 +0,2 +42,60 +13,68 +48,59 +6,18 +36,28 +61,0 +63,28 +58,8 +44,33 +59,6 +64,6 +12,62 +30,32 +39,56 +70,32 +67,44 +56,11 +38,6 +2,36 +60,50 +55,26 +58,66 +55,8 +48,17 +56,2 +64,0 +60,41 +64,24 +42,52 +30,13 +16,20 +30,44 +1,26 +47,34 +24,54 +56,8 +16,0 +2,32 +62,38 +70,56 +18,50 +9,28 +63,38 +30,18 +10,70 +44,25 +57,40 +28,26 +54,0 +36,12 +32,24 +44,62 +52,23 +19,54 +45,30 +51,68 +8,8 +48,62 +40,60 +48,6 +48,69 +22,36 +61,10 +62,28 +51,66 +14,18 +53,56 +29,52 +63,4 +46,50 +26,69 +52,56 +21,54 diff --git a/solutions/alv67/day18/test.txt b/solutions/alv67/day18/test.txt new file mode 100644 index 0000000..79c8583 --- /dev/null +++ b/solutions/alv67/day18/test.txt @@ -0,0 +1,25 @@ +5,4 +4,2 +4,5 +3,0 +2,1 +6,3 +2,4 +1,5 +0,6 +3,3 +2,6 +5,1 +1,2 +5,5 +2,5 +6,5 +1,4 +0,4 +6,4 +1,1 +6,1 +1,0 +0,5 +1,6 +2,0 diff --git a/solutions/alv67/day19/day19.ipynb b/solutions/alv67/day19/day19.ipynb new file mode 100644 index 0000000..93d7572 --- /dev/null +++ b/solutions/alv67/day19/day19.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# --- Day 19: Linen Layout ---" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['uug', 'wwg', 'uuu', 'grburwrb', 'uubrw', 'bw', 'wwbb', 'bugg', 'wb', 'uwub', 'ubb', 'ubruug', 'bgr', 'gbw', 'ruw', 'brw', 'ubu', 'bwgb', 'bwbbgg', 'rbu', 'rbww', 'uwwgubg', 'urggw', 'urgg', 'brubwurr', 'wrrbw', 'wggbbr', 'rbbrwg', 'uubb', 'rbuguu', 'rwugwr', 'ubugw', 'buwuuuu', 'uuru', 'wbbrb', 'gbg', 'ug', 'wwr', 'grbwgw', 'ugu', 'brwwu', 'www', 'bgwguuub', 'gur', 'ugbgubrg', 'ururgu', 'ruru', 'uuug', 'urw', 'uwg', 'buwuguwr', 'ugrw', 'rugrrr', 'wwgr', 'gbbug', 'wrbb', 'gwrgw', 'bgw', 'wbuur', 'wurbrr', 'rg', 'bbubgur', 'bwb', 'uwwggg', 'rugwwg', 'rggwu', 'wugwbggg', 'rwrw', 'rrgrw', 'urwg', 'rgw', 'urg', 'gbuu', 'gb', 'uwbwbr', 'ruu', 'bugrwbu', 'bwuu', 'wug', 'uwrugrw', 'uuww', 'br', 'ubwub', 'grbwu', 'brruur', 'wuubr', 'bbr', 'wrrubu', 'rwuugbg', 'grbwbg', 'guu', 'brg', 'wgwub', 'gwr', 'wgu', 'ggbrbb', 'bwub', 'wgg', 'wbu', 'wwb', 'bwrgu', 'uwgr', 'grgw', 'uurgbg', 'wrwbbg', 'ubub', 'bb', 'ruuw', 'uwrbugu', 'gwrb', 'bwr', 'rguwuw', 'rrbr', 'rubbgr', 'wrggu', 'gbwrbb', 'uugguug', 'gbbb', 'rwugg', 'wwbubr', 'rrurgbb', 'bwrwugr', 'ugg', 'brbuubb', 'bwbwrug', 'uwr', 'wuggwu', 'wuwww', 'bwbgrwbw', 'bubur', 'ugrb', 'grub', 'grgggb', 'uwru', 'wgr', 'gwwrg', 'wubu', 'bgu', 'bgrg', 'wuw', 'guwu', 'rbuwb', 'uuwgr', 'bggrurg', 'wrurbb', 'rgrgrbg', 'wbwr', 'uuwwub', 'ggwr', 'bbwg', 'rbg', 'wur', 'urgbg', 'wbr', 'uwwwrug', 'rurw', 'wwbgwub', 'urugwbw', 'g', 'uubg', 'ur', 'bwur', 'uurwruub', 'uw', 'uguuur', 'rub', 'wgb', 'wrrwuu', 'uwug', 'rww', 'wrrwuw', 'wbw', 'brr', 'bwrugg', 'ubgbbrr', 'gwg', 'uggbwb', 'uugbb', 'uguwubuw', 'wguwug', 'bwg', 'ggb', 'wgbur', 'urr', 'bbuwg', 'burur', 'grrb', 'gubru', 'ubrrugr', 'ubg', 'rbwgu', 'uwgbw', 'wgubw', 'gwgrrw', 'rrr', 'wbwu', 'ru', 'guwgg', 'rgr', 'brurg', 'rr', 'gw', 'wurbwgw', 'rrw', 'ubbr', 'wgub', 'wrrwu', 'gwguwrbw', 'uurb', 'rrg', 'bbgwu', 'uwwb', 'uggugw', 'rubbrgur', 'gwu', 'wrgwwg', 'gubbg', 'wggw', 'uuwr', 'ggru', 'wuu', 'bbu', 'bruwu', 'rgbrrwwr', 'wuurgbgg', 'ubugwgg', 'ubgr', 'rguwu', 'ruug', 'bwruubg', 'grgwrw', 'bgrw', 'uwrwg', 'gbbg', 'guuuu', 'bgwr', 'wwwuw', 'rgrw', 'rwr', 'wrurgr', 'rw', 'wwu', 'wbbwwrb', 'rgbwr', 'bgbwg', 'wr', 'wgugr', 'grw', 'gru', 'wurubug', 'wgbu', 'uuuwuug', 'rbgw', 'wuwur', 'bbb', 'ugwr', 'ubuwub', 'rbwb', 'grwgrbg', 'bg', 'bwww', 'guub', 'ugw', 'uub', 'ugbw', 'rwub', 'bggwuuu', 'bgwwg', 'uru', 'uggbrw', 'bggwg', 'gubgwubu', 'bguggu', 'uwuuub', 'wwwb', 'ugb', 'rbb', 'uwwg', 'bbw', 'bbruwr', 'rur', 'buw', 'wbbr', 'ubrgugrb', 'grurg', 'ggugr', 'gugwr', 'ubuwu', 'rggrg', 'wbrb', 'bwrr', 'wbg', 'ww', 'gwub', 'grgubu', 'brubu', 'gbwg', 'brb', 'rurug', 'buwu', 'gbbbwb', 'bbgbw', 'rug', 'uwrb', 'gggw', 'ubrgbu', 'bru', 'gww', 'bur', 'gbggrrwr', 'uuwuu', 'bgbgw', 'wgbr', 'grr', 'gwgwrbr', 'gbb', 'gbr', 'bbbugr', 'uuw', 'wrg', 'gub', 'gg', 'rubgggg', 'rugg', 'urur', 'rwbu', 'bwu', 'bwbuw', 'rgbgb', 'bwgr', 'rgwuw', 'wbruw', 'ubr', 'wrb', 'rbrbb', 'bu', 'uwu', 'gbwwrr', 'buuguru', 'uggrw', 'wbuurur', 'wgrw', 'wrw', 'wgbggrru', 'uubburwb', 'bgbr', 'rbr', 'gug', 'wrr', 'uuubwgr', 'buu', 'uu', 'wububwg', 'ugwruu', 'rru', 'wgrrbgg', 'gguw', 'ruub', 'rgu', 'ggw', 'rrwu', 'rwggr', 'rwwbwu', 'w', 'uuguw', 'wwgbu', 'brggw', 'rbwgru', 'guw', 'wub', 'gwuggur', 'grrw', 'wg', 'ubbguu', 'wgggb', 'uwb', 'uwwu', 'wrub', 'uwwgw', 'rubwbrr', 'wgbrg', 'bgb', 'bbwb', 'brgb', 'rwu', 'uur', 'bbruurrw', 'u', 'gbu', 'urb', 'wuwbggg', 'rwwrbr', 'gwb', 'grgrburw', 'bwrg', 'wbb', 'wuurw', 'bugbuug', 'uggrb', 'gubbgbb', 'bww', 'bbbw', 'gbwwr', 'wruw', 'rb', 'gguww', 'ugww', 'wgw', 'rgrwwg', 'gwbwr', 'brrw', 'bbrubu', 'rgb', 'rbwu', 'rrb', 'gwugug', 'rbgb', 'bgwg', 'gu', 'wwugguw', 'rgg', 'wbugrr', 'ubw', 'rbrru', 'grb', 'wrurrw', 'ggg', 'wbwg', 'rruu', 'ugr', 'bgg', 'ub', 'ggu', 'bbbr', 'rbw', 'bug', 'gggwbu', 'bbuu', 'urrb', 'gruww', 'b', 'uww', 'brbuw', 'urbubg', 'gugwg', 'bub', 'grg']\n", + "['rwrurbburwbwwwwbrubbbwbwugwrbrubwuwubrbwbguuugguwrubgbggw', 'bgrurgbbwrbwgbggrruuguwwugbgwurbrbgbgrguuuurrwrwwgggr', 'gbbgrwbbbuwrwwubrgrguwwuwrgbrrwwrbggbrbuwuurggrbwggr', 'buuwggbwgbburuugrgurwbbwugbbwuwuwrwbbuguwur', 'uubuggugwrgubbwguugbuubwugugbwwwgbrbuggbbrrgbrguwuuurggbg', 'bubwurbrwwbwurbgburbwruwbgugwwrggwubuguggbgwguuububuww', 'gwrrgrwbgwugwgwrgrrwwbwwwrbbgrwbgwbwwgurubgggr', 'ruwwwbbuuuwuwgubbbgrbbrbggwwugubggugrwwgwubru', 'brwbwbugrwwuwbgggrgbruwugbgbwbuuwwwgwbugugurbugg', 'wrugrrggbrwuwubbwrggrgrburwggruwuuwwguwbuuuwuuwugrgwrggr', 'grrwggrrgurubwbwrgburgubbgbwggurguwbgbrgrr', 'ubbrrbbbbbbugugrwgguuubrgwbrgbuwbubgburrbwb', 'bwguwgrguubbbbwbgrrwbbgggggwgurguguwrbbburgwrruur', 'wwwrbggwrbbuuburrwggwuuurubbwwuuubwuugrbgwwurrgwg', 'rrrbuwuubgwgrrgrrwwgrrbbwbwgbbrwguuwbbwwgbrbrgrwgurggguww', 'uuugrgwruwgbbbrwwuguggwguwurwrgbubwgwrrrruuurb', 'gbgggwgbuwrurrgwgwbgrwrwrubbuuguuwrubrgrguggr', 'ugubruguwggubbbbburubwwbubgbgubguwburrubwggr', 'rwguwrubrggrruggrbubrbrwwurbuwrgurgwguwrugrrrwgbuwbggrrw', 'bbwwuguwwruuruwgguwbburbguurbgubgbwwwwrwuggr', 'wugbwwwugbubbwggbgwbbrgwbugwubbrwbggbbuwrbburggwwrr', 'bwuwugrwruwwrwrbwbuwbgurrgwguwgbgbbrgbwgwgrwgwrgggrwwgrwgw', 'wwrubrrgrwuubgrubgbgbwrbwrbwbrurubwuruubbbrruuubuwugwwb', 'gwugrbwuwrwwuugbwwbbrrbwurbbguwggwruwwwwrbuugb', 'gwruburwbggbgubbwrurgubrgburwrwguggbbruuwbbrguwub', 'bbrguwbwgrubuuruwgwrwgruuggwwwuubuubrwbrwwbburuuwugrgu', 'rrwgwrgugrbbbgrwuwrgbbrwwbugwwwurrbwgrubrbgugugrbbb', 'rbwwbuubbubwgbwggurwruugugruwbrguruurgrwbbbrbrgrbwrggg', 'brurwgrugbgbuuwgrrrrurrbbwuubwuruubrgbrugrgbruggbbbg', 'rubbuwwgugrurbbguubbrrbgrggugbbrrgbwuwrgbrrwwrgurwurwub', 'ubgrgwbrrbggbbgbuguwrbruggrruuggwuruubgguu', 'uugwwgwbrrrrgbwrruubgbwrwurwuuwbwuwwwggbuwbgr', 'rbwgbuwwgrgurbuuuggbgugwuggwwbubbugwgbwbgugggggwgrrrr', 'gguurubguwrrrgrwgrwbbbgbruububbrgwgbrugugwggr', 'rubgbgbrbrwgbuuwbwrwrruwwgugbgbbrwubwgbbuwbrgb', 'rugguwbwbgrwbwwuurgbgwbwwbwgruwrgurbrguuurgubrggrubwwwggr', 'bgrwrubuugwgrggrgbwbruwubgwrggrrwbwgbubgugw', 'ggbwbbbrbgwgbrbugrwwububrrrgugbrggbwurruwwwgb', 'brurguuwrrgguuwgruuwrwbbubrrgubbubbgwwgwwwgbwbrbwwbwb', 'grwbgbwbrbgrbwwruwuuwbgrrbwgbuwbugggwbrrubwgrwbguubruw', 'rugugrwrrurugguwgubuwbguubguubgrbggbgrubuwuwuguurrbgwbbw', 'uwbbbggrrburugbbbuugrrrrrwurrgrwrbgruggwgrgrurwggrrb', 'gbbbwrbgbrbgwwuggwbuggwwrbbwrwruuwgubbubggrrgugur', 'wrgrbgwbbugbgubrrrgubwwwwggruuuwuwugrwgbburuwrwbuwrgwbbgbr', 'rwgwuwbrgwurrwbubgwbgggguwrwwwuguuwuwuwwgwrug', 'rgwbwrubwrgwwgwrgwururgubrbwuwbbuuubbguwgrgwuurrbrruwb', 'wwuuggubrgrgbrbwguububgrbwugwgrwurrwbbrguwgb', 'rbwrrbrrubwuwrrwwrbbgurrwguubwrbbgrugbwurwwrb', 'wururbgrwgbwwbrbwbbugguwwwbugwrbgbbgrguuugbrubrugw', 'uuwgugubuwrbrwrrbwrbgbgurgrggwbgwrrwgurrwwwurbgbubwwgbwwgw', 'ubggrbbubgububrgwwubrwrgubbgwgbwwubwugwbwwgruwbgbu', 'ubgbbruwgbggrrwbuguurbwrwbgbugbwgbrbbuguuw', 'ubbgrrugbbugbwbugwwwgwwwrrgburbuwuguwrgugug', 'guwrubbrgurbbwwwbwguurruwruruwuwrbugrgbggr', 'wuggwbguwwrruggbbbgubwbgrrwgurrgrrwubrwgrbubg', 'ubugggwugurburgwuwurbrburbgubuwwrwwgbgwrrbggugb', 'bbwrwgwgggubuggwrgurwwuwgrgwurwrbwwguururgrbgbwbgg', 'ugruurwruubuwwwwrggugbruwwgwuwbbrgbbrggr', 'rgwbggbrwbgrubwbgrgwwugwubrgbrbbbgrubrbwbwbwgrbbwbuurrw', 'bwuugbgwububgrrwgrgubggrwgrrgrbugbbuwuububbrgugugwwwuuwr', 'wbuubwwgugrbwwwbggbrrrbbuuwugbgbuwwggrbbuw', 'bugwguurbggruwrrwwwwwwwrrruuggrbruguuurgbwrburuwrbwgruwwbw', 'wbgbwbrwwbbbrwgbbgwgurrrbuugurwgbbbwrbrbbwguggbbwggwrubwg', 'uruuwbwbgbuwrwguguuwuggrwwubbguwrrwwuuguuwbbwgbbubbrbwruur', 'wruwgbruugwbwuwwwwbwubbrrrrbwggrgwbgggrbrg', 'brgubuguwggggwwurbrgwbbgbubbggbbwugggbbwrwbbwuwbubuuuurr', 'rgwugbbruurwwrubgwugrrwuwuguwubuwrrrrbggr', 'bbwrbwwuwrwrgrugurgrwbgrrwgbbbrruubbuguwrwg', 'bwrbwbrgrrbuuuuguwrwwrrrbruurwrwwwwgwuubbwbrrg', 'grbbrbrguuguurgbbrwwgwrurrrwwrrbuwuuurgggr', 'uggwwrwwgugwwrgrgbgugwbrwuuggwbrgruburbrwrrgbu', 'uugbggbggwuuugbwwwrwbgbrrrwgwubwgwubrwguurbugub', 'buugbgwuwbwgguuwrwurrgwuwbbguugurbuwrrwuguurgrugubggr', 'gbuwrrwrgubwgrgwwgguuggbgwrrwbwbuwwgbbuuuwwbwrbuwbgrg', 'gurrwrbbgrwrrwwgugggrrgrgwuggbggwrgubrbbrrggrubbuubr', 'wrruwuggbwbgbubgrrrwwgububrgubuguwugrgrgru', 'ugrwgburwggbgwrrwuruwrrbrbrwbuubuurbwguguggbwwug', 'rwrubrrwwrrwbbubwbrgrwwrrbbrwwbrgbwgwurwrbgbwuuuuu', 'gbwugwbbwurugubbuggwbgurrggbbbgbrubbbgubbgw', 'wurggbrbuwwgwbubgrrruwurbruuwrrwwggrwgrbubgbwubuwrgwwwr', 'brwggruubwwuwwbgbbrurgrwuggrgrgbubgburggwrrrwbwwgwrgwgrbu', 'rgwrrwwgwuwwrwburuwuwuwwbgrwugrrgbrgruwurggr', 'bbrrwrbuwwubwwwuuuwbbuwuburuwwgrbwuuuubwwubgurwbgwbrbruggr', 'wrbrbrrwurrubwgwwgugrubbggrgruwwbgwubwurwwurrwwwgwbwruwbgg', 'grurrrwbwrgrbuwgbggrruwubrbbrrrwrrrubrbbbbbrrbbrbrwrbrg', 'bwbguwgwbuwugbrwwrurwbuugrwgwwwrrrburguubrrrwgbwrrrbuww', 'uggbwrwruubuwrruwgruruuwwggrgrwbwugwrgwubrrruwbbbugwrwgwgg', 'rgbwurggrugwbwwbggrgwuguuuuggrguuwwgwugguwggr', 'gurggwgrguwwgbgbgbwrgrgwwrrburugurguuwurbbgbuurbubuwwwwugw', 'wwggwuuuugrbwbgurwbguuwbbrwbuuwgguwwrwbgbgrgg', 'gubrwbwgubguururgruggrrrwwbrwuwwbguggwbbwrurbrru', 'wbggbbguuugrrugrruruwuwgwuuuwugrbrrwrrugrgbrwuwgwrrbw', 'ugbbubbbubruwrwwrbgubuubgwurugurguwgwbrbrgurubwrg', 'bgrbrubugwbuugwbwrrwubbrbwgwggbuwgbgwwuwwggr', 'uubgbrrbgwrwrrgwwrguuwrgguwgggugbrwgbuwuwwbru', 'rbgggrrgbuwburwgburugrbrbuwrurgwuwrgrruubwwbbu', 'gggwgggwggrgububgwgwrbgwwubgurubbrubwurrgwgugrubuwbwgwbbwggr', 'uwgwugwrbwwwrgrruwgggbwgbrbwrrwrbgggrguubgurbruwu', 'wrwgwuuuugrbrwubrwguwrrgbrubwrbrruggubwbrgbrub', 'gwbubburbuwubgrgrguwbwrrubwgugggrgugbggugrwrrb', 'urwgrwrgrrgrurwuubuwuuguuuwugrwbuwbbwbrrurwbbrbr', 'gbwbuurrwwrwbwwgwbubbrgruuuwruuwgwbwguubwrugrwggrrgggr', 'bgrbgrbbrrbggruwburwrurwrwrruggubuggugbgbg', 'urwubgwwgrugbbrrggurgrgubrbwurgwguurwurubwgrurbgwwguur', 'buburbbuwwugbwgubbbgbubggggwbwguuubbrwrwbruugwu', 'bwwrguugrubwurbwbwwwgbwbuwubbbbuwuugubgbbubgbub', 'rguggwrrbwuubuwurbuggrbrruwuubbwguguuwurbwurrgwwbbbr', 'rbubwugwuwwbwwbwuwuurbuwrrgbubwgbggrwbuugu', 'bbubbuuurgwggbbwubbgrrbgwwwwrbububwurwrurrw', 'bugwguwbuwgwrgwubrbrwubgbgrwwruwurbubbbuuggr', 'uguwrwwwwrwwrbgrbubwbruuwgggbrgrbrwbrrgurgbbwrgrg', 'gbbwrwuuwuwwrrgbbubuugbgrwbwurwgruwburrgbbbrg', 'rwbubrwubgbwgggwgruuwuwbuggburruuubgwbbbrgrubgwwgwrubbw', 'uuwuwuwuwgrwrubgbubwwbrurwurgwgurbuwwggguurwbrrwwrwwrwgur', 'rbwwbwrrugugrbuwruruwgugbguuwbrwgurrbrguuurgggbggbrrbwru', 'rrrwbrbrgwgrgrbgbwwurgrgbuubbgurwbwruurwgugwrgwb', 'grwrburwugbwrrwrgbuubrwwrwugruugrwbguwgbrw', 'wrbwwurgurrbgrwrwrgbwwgrrgggwrbgugwubugbgrbrbbugwrwuwb', 'rbgwrguguwrbggrgrugwwbwrugbrrguwubbugwwurrubrbgwwwuu', 'bbwuwguuggwrgbwrugrurbgwwrbrbuubwwwuubggurrruw', 'urbbrrburbwwbrrbwubburrruurrwwbbrgubrrrguuuubgwwbgbrbgbuw', 'rwuwbrrggrurrwrugwwrwbrbrgurwrrguwruubwguwggrgrugu', 'rggrugrggburwubruuguwrrwwbuguwgbwbuggubgrgrwuwugbgggug', 'rwrwwbwwrrbrurbgwuwbbgbrrwguuwbwwggwugwwrbggr', 'burgurrgrbrwrwurggbuubugubugrwruugubrbgbwuwrrbuuu', 'urrwugbwgwgwuwbbugrwurbbbwwrbwuwuurwgwgrbrrbgrwgbgggbbwggb', 'wgbuubwwbwwrgrrruugrbwwurwwrggubruwbuwrburgrwbbg', 'uubwwgrggrwgurbubggwuubwugurwwubbbwuwrwrburrwbbbww', 'wwgrrrbwrubbguruurrwrgbugwuwuuwubbgwgbwrbgwuuwwwwggr', 'wgwbgbwrgwwubwggwbbgwrrwgrrrwrwburwrburwugrbgggwgb', 'uruwuwbwuwwgrwrwubwuwwgggbbrggrbuwwwbuuubbubuwbggbrwg', 'wuuwgurbwrrguggggburubgbuwwruguwrugrrwgbbwwggrwbwbrugrbbwg', 'uburrugwrgbrrwbgwwwbwbuguubrubrugurubrbgggbbuuru', 'bugwubrgugrbwuwugrwwruugrwgwrwwrbgrbuubugwbub', 'ggubbgbuwggugggwwbbbrbbrwbwburugwurwrwgubrwrwububruwbwr', 'brubbgwgwwrrurbbburubbwwrubwwbbgurgwbwugrwrgrugrwuubgw', 'ugbuwwwgrugrwwrgwbgubrgrgwurrwgwgbrgbrgrgggwr', 'ggruugbwbbubugrwurwggubggurgbwuwurgwggburwbuw', 'bgbrrguwgggbbuurbugugggrwuuggwurwguururuwrrrrwb', 'uwrruggugrbgbgbrwwggbwggrbwugurbwwwurrwrgg', 'gwbwbubuuuggbrrwburrruugbrwwwwguwwuuuburwrbguggrww', 'wbwrwwwwgubrwuubgurrbubgwwrbgwgurwwwurwwrgurrr', 'urbgrbrbbuubwrgbrrrrwrrgugwurwbwwururubbrwbugugubugbwug', 'rwwbwguggwuubwrwuugrbbwgugwuwurubbuuwrrggr', 'wguggrbwbwububgbugrgwbuuwbuguwwbuwrgggbuwrgwwuwgrwwbgrggb', 'wrggwgrwwuburgwgubgburbbrgwubwrwbbwwuurbgu', 'gubwruwbbwbuwbbrrgbrbgbrrgwgruuwrurbruwbrgbbbbbuuwbbg', 'bbwgbwrrugrbwuubrwurwbgbrgbrwgguurrurrgugwwugwwbrwggu', 'rrbuggubrbwrrbggrbwgwgwbugrrgwbburbrwuwuggg', 'wrgbbbwrggbggrrwrgwwwrrwgbggrbuwrbrrggrbrggbugrwgggr', 'uuwrbrbgwbrbubuggggwruwbbggwbrrwwwbgruuburwbggw', 'wubuwugggbwwguubugrwwuubwgguguwwgbrwgurrwwgugrbugbbrruugbw', 'urrgrwwggrrwuwwuburbruurbwrbuwurbgrgbwgrrb', 'urwgwggwgugrrggurrbubruuwrbbwwgurrggruugrruwbrggr', 'gwuwbbbububrbwbrbggbbwbbgwrgrwbburugwuurrbgrgwburw', 'rwwguuwbbburwruwgrgwggurgrwguguggwgrrrrubwrgbgw', 'gggbbubgurbgrguburbrgrwwwrgwuuubrbuwububwuwgw', 'wrubrrrgwbbbubrwrrguwuuwgubwwwgrubrruurwrubwugbbbbuuggru', 'wbbbgwrwrubrrgrwbrbbrrwugrruwwrgbrrgbwbbggwwguuurwwbuggr', 'rwwggbwwgwrbwuuugugggrugbbrrwwwgbwbugrbrrgwrwg', 'urggbwrugrbwgwguwgbwrruruwrrwwuwgububguugwrugrbgbwggbuugug', 'gbrgrwbbbuwuuwwgbubbrguwrrgwwgwubbbrubgburggg', 'brgubugrgrrwbbgrgwgggububbbrbrubgrrrrwrruububrw', 'uurwwwwbrguwguuwrbgrurwbgrrguburwgubbbgbbrbbgbwggrg', 'ugbgburbrubgrbuwbrubbrbgrbbgggrgugbgbgwwbugwrwr', 'uggrrwwrwgbuurrurrwguugwwguwrubbrgurururruu', 'uurbggbuuubrurbruwurbbgrbgrbrbbgwuwwwuwugg', 'grrurrbuurwwgwbgrbwbubbggurguwgwuwuubrubrrrrwurgw', 'rbgugruguugrubgrgggurbbrruwbgguuggrrrrbbuuuwbrurbbggrgw', 'rrbrbrbbgbuuwubwguwrbgrugggrbgbgrgbgwuguurwgrurbgbwrggurug', 'brwbwbbrbbwrrggwgwbuwgbbrwbuuwwwubwggguwgruggwuggrgrww', 'ugwgbruwubbrgwgwgbgbgbruwubugbgruwggrguwwguwuugrurbgb', 'bbwrwggburgwgrwbubrrwugggubggurrbbwbguwwurbggrr', 'ruubbuwgrrwrggggrrgrbgbgurbuwgurguuugwgrur', 'ubruubbbbwwbruuurbrbugwbrrgbuwrwrggrugrwbwb', 'wrgubrwbgwbrrrrwgbggugrgwgubbggwrgwwgwuwubggbbwrwg', 'ugugrbugbuuwwugrwwuggrwggwbbubugururugrbugwgubb', 'gubgwububwwbrrwrrbugrurgbbrrgbbggwggbrwguu', 'rgrggwwugwwgbgruwgrrubrgbgbubbugwwgrurgwubr', 'ggbbuubwwbwbrgggbgbbbbwrrgubwrwgrbwbubwrwgwwbgwrbu', 'buwrwuugbrwgrubbbrbwrugwgrruguubwrbbgwrwrwbgbugrgrrgbbgb', 'gurububbrwgggrrugwbguwrgrbrrwrrbrruwrrwurgbbubrrwwg', 'wgwrwrrwuguugwwgugwwwbwgbrrrwbbbbguwgwwuguggr', 'wgwrwruugbuwwrwgwuguubbuggwrruwrgwwuuwrrbbbgwubuuuuwuubwbw', 'rwbggubwwwrrwrbwgbbwgwgbgrbbugrurgbbggrruwwbubburrbu', 'bwrgwbuuurubgbgwbguugbrrurgwrgwbuurrbbrwbggwg', 'uuugbbgwbgguwgwwgbbgurugbrwbgrwuugwuubggggrgrbrb', 'uuugrbbbbwggbgurrrbuguuugrwgubbgwuugwwubrrbwgwugwuwbbwgg', 'uuuwbgrgwbgrbrbrbwrurggbgbwbrbgrrwuruuwrwgbbruurrwwwbgbrggr', 'rwbguggbuguwburubbrgwgruurbgwrgbrurbruwwwurrbwbrur', 'urbgbbbgbggrrgrubgwrugwrwbruubbbgbrrrrbwbubuwggubbwrwwwggu', 'rwbuwgwgwwwuwrruwwwuuwggbubuubrwwuuwuwrubwb', 'gbbgrrrguruuwwbgubwbggrgwwbgguurwruubgwgwbbw', 'rburrgrbgbggrgbbgbrwuugrurrrrbrgurbbbrrugwbrgrrruuwgrbw', 'buuwuwwubbbuwubbgbuwwwwrbgrwrurgbrbrgggwuuruwggr', 'gbgbrugbuuwggrbrwruruuwwwgrwrwgwbrguugrwuwuwwuw', 'grbbgrrgwgrrubbwbwbwwrwrbgruubwwbbrgrwrwgggbuburrgbwbwwb', 'bwggugbbgwrrbbbbwrbrwbguubgruubggbuuubwgwgwb', 'wwwwrbgbrbwbrwwgugrugbwwwwgrwrugrbgurbrurbwrwrbugburubwggr', 'grruwwrwwwgrruuuwuwgbgbuwbrbwbubgrbwwrbwuubwwuwwwgbrggr', 'gwwuwwrbwbbrbguuwuwbgwbrwgwwgwbburwwgrurrubbwrwubwuggur', 'ruwurrgwggrrbuubbuwrbuwubrwbrbgbwwbbrubwgbwwuwubww', 'rburgwbwgrwbrbrbbbuuuwgwwrubgwbrrwbubuwbuguwuggr', 'uruggwruuwrgrrbubrgrgurwrbuggurggwuwwbwurugrrgwrruuwrb', 'wggwgwbgbbbgbrgbbbbruurrwwgurbuguwbbbrugrbrrrwgbguwuruwrww', 'wwrggwbrbubwwuwbggugrrgubruburrubburugggguurwugbwwuubww', 'rgurguwgugbgubrgwbwgurgbgrgbwbwgruuguwurugwggr', 'wgruwgrwurrgbgwbuwbububrgbwbburruwwuurbubwwggrwgrurgu', 'wrwurgrwbubgurrrbwuruugruwwurggrbwwguwwwuwwubbwgwugwuwuwuggr', 'wbbwgwbbgrrruubburbwrrwwrbrrbubugwuruwgruburuuruwrrw', 'bruwrbgbubgrwurwguggrburwrbgbbgwgwugwrrbww', 'grrrgurbwwugrubbrurgurugwwbgwgrruuwgubgurb', 'rwurbrwggggrbbbrgbugggwrrbrwwgrgggugbrgwrbgurwrbuwug', 'uwgrbbbwbwgggwwbgwgurugbbuwurrgrrgbwrrrrgburgbrgrbwgubu', 'bbwuuuugrruwgbbrburbwuwruggbbwbwrbrrwwubrrguubrwgwgbrw', 'gbrbwrwrwrrwwuguuwururugurgbuwuubwwgrbbbgbuwbgburrggr', 'grggbrwwrwubbgbrgrrrbuugugrrgrbwgbwbubwrubrrbugg', 'gbuggbbrwgrbgwrwubwggbwgbrwwwbbuubruuggurrrgburbgrb', 'rrrwugguwrwgrugbbugbbwwgrrrgrguwguuubburgubuwgbuwrrwrgbrggr', 'ubrgggwwbrbrbgrbrguwrrwguwwbubbuwubbrwuugbwgggrggr', 'urbbbrrgwrrbgbbgguuwburuwrurrbururgbwguwgbrgrwrwg', 'wubbbgrugwrubgubbbgwwwwbwgugrbrgubwrwuwwgwwg', 'buuubugbgwruuuurbuwrruubgruugwgbrrrrgggr', 'ggubwgwbwrwrwrbrbuurruwrurrrugbgburuwwbbwg', 'gwubbgrgrubwwuwburwrrwgbrbrbgwgguugbbwgwrubgwub', 'wrrgubrururgwgbwbwrwrrbuwrbrgbbggwbwggbbww', 'wwgbrggurbbwurbguuruggbgrwwrgbrwuuuggrgrbrrwrgb', 'buugrgrbrrwbrbrrwuurgrbrgbrgburgggbwburgrwggrgrbuubbbbb', 'rbrwwgrwwuwgwubbgrwggbgbwbwwrrrrbruwbrgrbgrgubburwrugurgb', 'wwbburgwgubgwwrwwwrwurwwwgbrwwgbwbgbgbrugwrgugwgrr', 'wguuwguugbrgwbgrgbgwbguugwwbrgbgbbbwwbuuuuguuwubbwgggg', 'rbwruururwguguwbbrrwrubuuuuwrgwwgurggrgwggbruuuugrw', 'wrgwuuwuruwugbggwrwwbwrbggwurbbbrurbbbbrbwwrbbrwbwbburru', 'brgrgubbbwrbwwubuugrwgrgubrwrguubuwbbrruubuuuuguwggrrgr', 'rgwbgbguwbububrruugrugrugrrgwubrgwbrguwgwbrrwgww', 'ggrbugurbbbbrwrwurrubbbuuubwgwrbrbbuuwbrrgurruugwrurg', 'rrbuuurbrbuwuwurubwrwurruwguurubgrggubrguguwwbwggr', 'uwbruggwwwwrwwgrwrwbgbuwbubbwbwbubwwgwbuwrbgruwrgbw', 'wwgwrugwwwbuwwubggwbubuwwgbwuwuggrwurwuwgrgubwrwgbuwurggr', 'wwbrrgbrbgbbbggwuwwwggruuugbwgwgbwubgwbrbwubgwbwurgwrgbggr', 'gugwwuguwwwruwrrwuwbgwgwwwrgwbguwbgwuuuwubgwbrrrwrbwg', 'brrbbguggwrrwwrwurguurwrrbgrbggrugrgggwrwub', 'uubbrwururuuuggwuwgbbbgbwbgwgwbbuwwbbgbrbbbwubr', 'ggburbbrggbbwurrggbrrwrrurrgrrguwrgubgwububwruwwggr', 'brbuuuwugrrguburrgwuugwbbrggrgrgguguguwbrwbwbbwwugguwwwu', 'uwgburrgwuwuguubwrgrbbwwggbuwrrrbbrbubwruguwbubgurbugwbuw', 'rbrruuuugggrubgbuguuubrugwwgugubggguubwugrwgr', 'ruggwrbrbgguuuugggurgwbbbgbwrbwbwwurgrwgguuuugbwbgwwgg', 'wgwbugguburwbwgurbwrbuwubgrgbwbwgbwrugurwuwwrwbb', 'gbrgwbggbgrbwguuugbggruwwbugrwrurbwbuubgguuwb', 'gbgbbuubburwbwbwubbuburbwurruruugwwrugbrbgwrrbrgruggu', 'gugwwuuguuguwrrrbwrgggbbuuwbgggwwbubbuubwrwgrrbrgbggurb', 'wubwbbwbgrwbwburwgruwguwwwubwwburubrugrbwgrb', 'wwuguwwwgggwgubggbgwbrbgbburgrurbgbbwbubrr', 'rwwwgwuugbguwbbuwbgwbgggrbuugbgwurrwrwugrruburr', 'uggbwbwuugbgbggrwbrwbgbrbgburbrubwurrbbbrwwbgrwwbwuggu', 'bbgbgrrwgrbuwubbwbrgubruwwbbgrubbugwgbrbwwgguu', 'wuwrrgrurubgwgbrgwbruggrubggwwgwgwgggrrrrbg', 'ubbwburrwrrrwugrrrbugwgwuggbbgbuubwrbwwrrgbbu', 'rurugwwbguguugruubwrrgbwbrurgrbrubuggwruugbbwrbb', 'bruguruwgrugurrggrurubgbuwuguwrgugrwwggr', 'bgwgrbbwgrrrgwrwbggrgurbwubgwgruurgrrwuurgbrguwwu', 'ubwwwbrbrgbgrbrbgubwrrgrgrburwurrwwruwwgrub', 'rgrrbrrwuwrwwgwwrrbrbwbbwbbwwurgrwgbggrbuw', 'bgrrrruuuwugubwbgguubwrbwwbugruwgbbbwguubwggugbgubrggwrw', 'brrbrwuwwrwuugurwuwrubbwgwruuuubgrgugwrurrrwuggw', 'uwgwggugrugrugbuugurbbrurrwwbrgurrgbggbwub', 'rubgbrguguwbuugbwwgbbrgwbwbbrgrwbgubgbggrrwru', 'guwwggururbwwgrgurrubgggurrrrgbgwugbbbburgrruwrruugwbgrg', 'buwgrrubrrubwgwuggwuggbruwwrgwggbwgugrwrwurbubgbuuwgugbgur', 'ugbwbuuburgrugwrggbrrgugwbrbbbrwwbgrgggbbwbubbgggrgguugu', 'buurgwubgggwuwgrrgbwurbuwwruwbbubbwbuubgwggbubbbbrwurrurg', 'guwrgbrbbrrwwgrbbwgrgbguwbuwrggrrgugbrbugguuwgrugrwurbuwu', 'gwbwgbggbrgrwwrbbggwgrrgubwubruubbuuwwgbubbgbg', 'urbubgbrbwwwrwrbbwrbgwbrgugbrwuwbrrbgbgwguuubbbbwggr', 'brbrrwbgwgwruuurggurruurwbwurbgggugburbuwbrwrguubwbwwwg', 'rbuugguwbbrggwurwrgwruruuruwbbrrwbrgubbuggbuuuwrwrrwuu', 'rwurguwrrbrbrrurrubrwuruwgbrbwwuwgwuurwrgbbuwrubgrrbrbwrrr', 'guugwuwrgwrbruruwwuuugubwugbbugubbuwrrgurwwu', 'wuuuwwwbrwwbguwwbggbrwrubuguwrwrwwwwguubrwwbrwuwug', 'bruguwrbbrrgrbbgwgrbgguugrgwgrbwbbuuugbwuubgrwrr', 'wwgbbubbrugwubrbwwbwuwgrgrwrwwubrgruuwggrrrrggbwrrrrg', 'gwbbrwbruubguubrgugrbgbgwwgurrwwuwruurrgrrubwururbgrgrwbggr', 'wbugrrwuubgbwwwbgrrbubwuwrgwrubgrbbwgguugg', 'gburwuwrrgwwrwbrgrbggggwuubuwwwuugrubwurwwbbbw', 'gwgbuubbwurbwbggugrgbwgugbubbwuuubbgggwgubggbwgrur', 'wgwwgrwbururuguwwrgrurrwuwrwgburrwgrwwggrrgbbrrbruwgbgbb', 'bgrgbrwrggwwbwrrurubwrrrgrgrgwgruuwuwrrgrrbbgwwgrb', 'wwuguuwrbuwburbubbgbgwbrurrrwgguwwbrrgbguwbuuwubggburbbuu', 'bwwurubgbwbgruwwwruwgbbggbrurgwuugrwwugguwgubwuu', 'ruwwrrrruggrbrbwrbrwurbrrgbwgwggubrburuwgbugbbwurwrrrrrw', 'wgubgrrggggguruuuwgbubrrbwuwwugbguwbrwuwgbwwrwuwwrrwwugrr', 'ggwugbbubuuurbwwggbguggrbrubbugburbuwgwgbbbwgwuwurugurw', 'guurwgrgrbrbwgbbgrrbwubgbgguwugbuwggbbuggr', 'rwuwbrrubggwbgugwrgbubbrbuuwbbubggbrggbgbruwuguurwwgwwrbb', 'buuubbwggbgugrbbrgrurbbwgbwurrgwrgwwuubrwwgug', 'bbggrwrurrwrgrrwruubbubrgrbgbbbbburrbruwgbuwrwgurr', 'uwubgwrrgbbrwgbwbwugwugbwbgwrrwuuggbgrwuugrbbwuubbbb', 'wurggubggrwggbwrurgwwugugubuguburguwgwwuggb', 'rwrrbgwbbrrbbbbwrruwuwwrruurubggugwurrrwubrbuuurruggurbrgb', 'bwwwbwrubwbwgbwwurbwubbburggbbwuurrwrrugwrbuuwruuwbrbgurg', 'rwugbrbwrubrrgggwgwwbwrrurgurrgwgugburruguuuwwu', 'brguuggbgurbgwguwrbwgwuggugbbwbgrguwuuuwrwubrr', 'brwguuwrgrwuuggwrubbugbwbgubbgrgwbgggurbrwubgbu', 'wurgruurbwuwbbrbrururbbwgurbbggwwgrubwuguwgrwgbg', 'grrbgbwruuugrrggrbuubrwwugbbwwurruwrrbguwurugurburg', 'rgrubruburbbuugwrgrrgggbwgbgugbbrgguwrgbgwbuwgwwwwb', 'gwwgwuuubwubwbggbwgwuurbuwruwuuubuugrurgbugbwrr', 'wrwwwwgbgbguwruguururwwubwrwwwgwrrwgrgggr', 'wwbururwwgwurwuwgubwrugrggrwwgruwwbbrwgbwrrwrggr', 'rgrwrbrwwbwwwubwgrbuggbwuwwguubwgrubwguggwrwgubwuurubwgbr', 'rurrbrbrrwugrwrbbrrggubruwrrburubuwbguuuruubrwrgwwub', 'bgurgrwgrggwrgurgbwwguwwrwgbruwwbwbguuuuwbrbw', 'wwuugrurbrurbbggbwrrwubwgbbgwbwrrwwuuruwwuwrrrggrbwugwww', 'gwgrwwrrubguggubbggggrubgwgggbruwgrwrgwrwrbwbgrrbgwwg', 'ruwubrrwggbbuuugurbwwbwbuuugbgbugguuwugrwbgwuguwuggr', 'bbwrurgbugwugugwuurgbggrrgwrbrubuguwbggr', 'ggugrbgwrwrbgwruwbuubggrbbrugwrbgwwbbgrwrrwwbbrwbrwu', 'bbwrbuwruuwuwwbgruwbuwgwbuwbbgrwuuwuguwgguugugrr', 'uwgugwgurbwuwrggwgbrgbgruurgbugrrgubwubrbu', 'grgguwrwwrruwruwrbbguwwgguwgbrgbwbgbuurguuwr', 'bwwggrgwrbgrurrrbgrbrwgbbwgggwwrbwubruwgrwuuwbguub', 'grurwwgwuugwgrwuwwrbbwrbruwguurbgguwwubbwgwwbg', 'gbwgrwgrgwgbubbwbgrgwrwwgugrgwubrgwuwgrrbgurw', 'ubrwwuwgwrgrgwgurwgrbbwwgwbgggubbbgrgwrgruguww', 'gwuwwguggrbbggrwrrrwbbwurbwururrwrwwgwubrg', 'wbguurggrrrwbgbwbrwbbubuguwggbwgbruuubuwwrbugbgbgbgbgg', 'rbbruggrruggwuwgguwuuwrguuubrubrgwbwrurubbwgwururbbbugurgb', 'rgrwugguubrbgwwuuwrgurgrrguurwbguwwgrgbbwg', 'brrwgrrurruuuwugurgbrurbrwrwgugwrrwwwbgururbrwwr', 'bwgguuwgbrwrgrbruwwbbguwwgbuubburwbgrwrwrrggr', 'bggugwuwbggubbbbuubbbguwurbrrubgurwbwrurwgbubwbbwwrgrgbbgu', 'wubrbbuwwgwwrrwgwbbgwwgwbgruwrgruuburbwrggbbwggugbwgugb', 'rrubgbbbwrbwuugggubruwgrubggbuubwwgubgrbrbgrrbbggb', 'buuwbwwbrwbgubugwbrgrgwwuwgubgwurguggbgguugbrrrr', 'grbgbubwbgbbgrwurwrburwgrggbwugrrwgbbbuwuwbgrgwrgrwbububuggr', 'ubwwuwwuuuwrbwuurguuubgrwgbwwgbgwbbbgburrgb', 'rrbuwgurbwgbuggggbgbggrbwrrubbbggrurrwbwrwgbgbwuw', 'ubwrurwrwgbgwbgggurgubwubrgwgggrubwbbggrwrrruwuwwuwrbgw', 'rubuuwrurrugwgrbbgbuwbrbbggwbrrrbuwgbgguugguwugr', 'guwrwbgbuguwbbwbwrguwwgbbbbrwrbuuburbwuwbuubbrggbb', 'gubururrrgwwuggbggrwgwbbrgrbuuburbbbguwwgu', 'wubguwubrbgbgrwrgrwguwurwggubbrbuurrbbbbwwuurwubuurbr', 'gguruwwugbuwguwgrwwugbguwuuugwwububwrrrruwgr', 'guwbwrbrbbgbugwgugwurbubgwrgrbbrwgrrugruwugbbwug', 'rbwuggbbgwbgrwubuwrbrgwwrbruwgggugwwwgbuwruuubwwuubwu', 'gugbbbwgbbwugwbgggwgrurgwbubrrwwwwrrbbbbrru', 'uuwggbwrrgrugrbwwwuwgwbgurbguburubwwbgbguuguggr', 'wrrgwgrbrbwuurwrbgbbbwwuwrguuwugbugwubwwuwgwrgrgrbbu', 'uwwwwbgurwubbwbbwrwubgruubwwguuwgrurgwrwgbrrrgbwrwrggr', 'wwuuggubbwwgrwubgurggrrwwrrbrguuwubgwrwwbwrurb', 'urgwuwwububrbwbrwwbrburggubgwgruubbuwburrrrrr', 'ubgggugbwgburbwrwrrgrguwgrugrbgruwurwgguuugwbubgb', 'wgubwrbwwgbbwrbugrbrgbwugrwugbwwuwbwbubggwb', 'buwbgggwwbwubuwwrbuwuggrwrbugwrruuguwrgrbrgrugb', 'rguubwwgrrbrbbuwrbgrguwbwwuwgbuuwwbbuuwwbwurr', 'bruubuwggrwuwubrgubwwbugbrgbrguwurrbwrwurwwggg', 'gwbgugbwbbwguwbuubbrurbbbruwwruugbwgwwuwbwuuuuwbbwwgbuu', 'wbguwwbbguwruurguwugugurubuuwgubbwgbbugrbbgggwubwbg', 'bbwruwurwbruggwrwuugbrwrwgrrbuwgwurgwbwgrrurbuwrrubgbgggug', 'ruugbugrubrrgrburwrbrrubbwgwwuwwrugrbggr', 'rrubrwbgruwubwwbrbwrwbbrgrgggugggwrgrrbbrrurbbugbrbrrb', 'wugwurgrbrgugbrgwrgrwwwrwgbuwbburgrbrwurwubrguwurbrrburuwb', 'wwbgurbrwubbuuuugbrrruurrwgbuurrgbbwuwuurrwwruubgrwrrg', 'uwwwrbgwubwwbwruwubbuggbuurgwwwbgrubugwwburrruw', 'rugwubwurrwugurbbbwbwbrrgwwuwwbuugggruugbuuguwubuwrrr', 'wgrurrwwwrggbrbubwgbbwrrbrgwwubwuugggbwggr', 'ubuwuuwgwbgwbrurrbrrbggwgwuwubguwuubgwrgruuurwgbgrgbbbrgw', 'rggruuwrwwwwrggrbgrubugurggrurrgwbuwrbuugwrwbwuuwrwwuwb', 'rwrgbugggubbwgubburwuurrwggurbugwbuugrwubugugwwruu', 'wbbguwbggrwbbwwurbubuwgbubrgwbuburububggr', 'burgwgbrgwrbbwwbuwrbugrggrbgwwrwwrgbgrbubwubwrwbw', 'ugrgwwbbbugbuubwurbwbrrguwggwgwbrurgburggur', 'rurrbwrgwubbrgrwruwwrggubbggrgugggwwgburbgrbw', 'gbwbwgbuugwrrwgwwuuugrrbbrrguugrbuburrrrbgrug', 'bbwgbrwrrwgbgrbwgrrurwbbuugwbwrurwwgwubrrwggrwwrrrwuwbb', 'bwbgrbgwbguugubwgwwrwbuwrrgwbuwrwgrrrgbrbwrbgwgru', 'wwrwubrwugbuuubwurwgubuggwrwgrwgurgwbugrururu', 'wrrbuurrwubwggwrwugwbrrgbrbrgbggrbgbgwugwruwwbgrwrg', 'grbwrgrbgwguwrbwbbgrbwrwbrgrrugbrrggrrgr', 'rugwubrbbrgbrbuuugrbguuugugubbbwugrgbwgwgbbrugubbr', 'gugwwugruuwbrrgurwwrurbwwbgggugrrruwgugbgguguruggbgwww', 'grrbguuburbbbwbrwwgugbgwrwguwbwuwrggwugbwbg', 'wgurbgbwgwbrurrbruruugggbwggrrugruurbrrwgbb', 'rggrrgbbwgburbwgrrbuubrgrbbrurrrbbrugbwgwburrrbbbrrrwwrg', 'wuuwggurgggbuuwuwrubgrwrwgwgwgbbrugbrrbuwgg', 'wrubuwwbbrbbburgrubugruubbbuwuuwrbrgubwbrgbgbwb', 'bwgruwwwuburgwbugbbuurruwuurggbrrgwuwurrgubwwgu', 'wwuwbuuwwrrwuguurburbuuwwubbruubrbrrwbuburwwwwwgugburwgur', 'rruugruwurbbwubrbgrwwugwugbruugugrrwwgugrrurgrwgbbgbr', 'rgbwurwbruggbgwgwwguurgggbuugbbrrrubwgruuubrbgggr', 'gbwgrgggbrugbrruuwgrbwrgwrwuggwguugwgwwburubuugu', 'ubruwrgbwbugrwuurgbggwgrguggbrrrrguggwwrwbgggwwbgb', 'wbuggrbburwwwuwgrwrgbwgrubuggugggrgbgubwuurbwgrbuwwuruubgu', 'bbbrwgwbgwbwbwbwuwwbubwrbbbgbuwgbgrgubguugugbgrr', 'wrbrgwbwbwgbuuuuwwrwguwubwwuuurrbrgwrugrgwrgbrr', 'brrbrbubgggrugurgubbwrurggburubwrwgubguwwrwbugb', 'guggurggrbbgrrgggguuwwbgbwrwbuuwwuguuwubuwbwgubbwguurwb', 'bwgwrguruwwrrrwwguggwubguuwbgrbwwubwgwgwuuub', 'rbgwuurgurrrugwuwgbbburrbwwrwgrrgbrwbgwrbrururuuuwugwbgggr']\n", + "The solution for part 1 is: 338\n", + "The solution for part 2 is: 841533074412361\n" + ] + } + ], + "source": [ + "# --- Part One and Part Two ---\n", + "\n", + "from typing import List\n", + "\n", + "def parse_file(filename: str):\n", + " \"\"\"Parse the input data into towel patterns and desired designs.\"\"\"\n", + " with open(filename, \"r\") as file:\n", + " input_data = file.read()\n", + " lines = input_data.strip().split(\"\\n\")\n", + " towel_patterns = lines[0].split(\", \")\n", + " designs = lines[2:]\n", + " return towel_patterns, designs\n", + "\n", + "def count_ways_to_construct(design: str, patterns: List[str], memo: dict) -> int:\n", + " \"\"\"Determine the number of ways the design can be constructed using the available patterns.\"\"\"\n", + " if design in memo:\n", + " return memo[design]\n", + "\n", + " if design == \"\":\n", + " return 1 # There's exactly one way to construct an empty design\n", + "\n", + " total_ways = 0\n", + " for pattern in patterns:\n", + " if design.startswith(pattern):\n", + " total_ways += count_ways_to_construct(design[len(pattern):], patterns, memo)\n", + "\n", + " memo[design] = total_ways\n", + " return total_ways\n", + "\n", + "def count_possible_designs(towel_patterns: List[str], designs: List[str]) -> int:\n", + " \"\"\"Count how many designs can be constructed using the towel patterns.\"\"\"\n", + " memo = {}\n", + " count = 0\n", + " for design in designs:\n", + " if count_ways_to_construct(design, towel_patterns, memo):\n", + " count += 1\n", + " return count\n", + "\n", + "def total_arrangements(towel_patterns: List[str], designs: List[str]) -> int:\n", + " \"\"\"Count the total number of arrangements for all designs.\"\"\"\n", + " memo = {}\n", + " total = 0\n", + " for design in designs:\n", + " total += count_ways_to_construct(design, towel_patterns, memo)\n", + " return total\n", + "\n", + "# ---- Main -----\n", + "\n", + "filename = \"input.txt\"\n", + "#filename = \"test.txt\" # decomment to use the test\n", + "\n", + "# Parse the input\n", + "towel_patterns, designs = parse_file(filename)\n", + "\n", + "print(towel_patterns)\n", + "print(designs)\n", + "\n", + "# Calculate the result Part 1\n", + "possible_count = count_possible_designs(towel_patterns, designs)\n", + "\n", + "res1 = possible_count\n", + "\n", + "print(f\"The solution for part 1 is: {res1}\")\n", + "\n", + "# Calculate the result Part 2\n", + "total_ways = total_arrangements(towel_patterns, designs)\n", + "\n", + "res2 = total_ways\n", + "\n", + "print(f\"The solution for part 2 is: {res2}\")\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/solutions/alv67/day19/input.txt b/solutions/alv67/day19/input.txt new file mode 100644 index 0000000..a83274b --- /dev/null +++ b/solutions/alv67/day19/input.txt @@ -0,0 +1,402 @@ +uug, wwg, uuu, grburwrb, uubrw, bw, wwbb, bugg, wb, uwub, ubb, ubruug, bgr, gbw, ruw, brw, ubu, bwgb, bwbbgg, rbu, rbww, uwwgubg, urggw, urgg, brubwurr, wrrbw, wggbbr, rbbrwg, uubb, rbuguu, rwugwr, ubugw, buwuuuu, uuru, wbbrb, gbg, ug, wwr, grbwgw, ugu, brwwu, www, bgwguuub, gur, ugbgubrg, ururgu, ruru, uuug, urw, uwg, buwuguwr, ugrw, rugrrr, wwgr, gbbug, wrbb, gwrgw, bgw, wbuur, wurbrr, rg, bbubgur, bwb, uwwggg, rugwwg, rggwu, wugwbggg, rwrw, rrgrw, urwg, rgw, urg, gbuu, gb, uwbwbr, ruu, bugrwbu, bwuu, wug, uwrugrw, uuww, br, ubwub, grbwu, brruur, wuubr, bbr, wrrubu, rwuugbg, grbwbg, guu, brg, wgwub, gwr, wgu, ggbrbb, bwub, wgg, wbu, wwb, bwrgu, uwgr, grgw, uurgbg, wrwbbg, ubub, bb, ruuw, uwrbugu, gwrb, bwr, rguwuw, rrbr, rubbgr, wrggu, gbwrbb, uugguug, gbbb, rwugg, wwbubr, rrurgbb, bwrwugr, ugg, brbuubb, bwbwrug, uwr, wuggwu, wuwww, bwbgrwbw, bubur, ugrb, grub, grgggb, uwru, wgr, gwwrg, wubu, bgu, bgrg, wuw, guwu, rbuwb, uuwgr, bggrurg, wrurbb, rgrgrbg, wbwr, uuwwub, ggwr, bbwg, rbg, wur, urgbg, wbr, uwwwrug, rurw, wwbgwub, urugwbw, g, uubg, ur, bwur, uurwruub, uw, uguuur, rub, wgb, wrrwuu, uwug, rww, wrrwuw, wbw, brr, bwrugg, ubgbbrr, gwg, uggbwb, uugbb, uguwubuw, wguwug, bwg, ggb, wgbur, urr, bbuwg, burur, grrb, gubru, ubrrugr, ubg, rbwgu, uwgbw, wgubw, gwgrrw, rrr, wbwu, ru, guwgg, rgr, brurg, rr, gw, wurbwgw, rrw, ubbr, wgub, wrrwu, gwguwrbw, uurb, rrg, bbgwu, uwwb, uggugw, rubbrgur, gwu, wrgwwg, gubbg, wggw, uuwr, ggru, wuu, bbu, bruwu, rgbrrwwr, wuurgbgg, ubugwgg, ubgr, rguwu, ruug, bwruubg, grgwrw, bgrw, uwrwg, gbbg, guuuu, bgwr, wwwuw, rgrw, rwr, wrurgr, rw, wwu, wbbwwrb, rgbwr, bgbwg, wr, wgugr, grw, gru, wurubug, wgbu, uuuwuug, rbgw, wuwur, bbb, ugwr, ubuwub, rbwb, grwgrbg, bg, bwww, guub, ugw, uub, ugbw, rwub, bggwuuu, bgwwg, uru, uggbrw, bggwg, gubgwubu, bguggu, uwuuub, wwwb, ugb, rbb, uwwg, bbw, bbruwr, rur, buw, wbbr, ubrgugrb, grurg, ggugr, gugwr, ubuwu, rggrg, wbrb, bwrr, wbg, ww, gwub, grgubu, brubu, gbwg, brb, rurug, buwu, gbbbwb, bbgbw, rug, uwrb, gggw, ubrgbu, bru, gww, bur, gbggrrwr, uuwuu, bgbgw, wgbr, grr, gwgwrbr, gbb, gbr, bbbugr, uuw, wrg, gub, gg, rubgggg, rugg, urur, rwbu, bwu, bwbuw, rgbgb, bwgr, rgwuw, wbruw, ubr, wrb, rbrbb, bu, uwu, gbwwrr, buuguru, uggrw, wbuurur, wgrw, wrw, wgbggrru, uubburwb, bgbr, rbr, gug, wrr, uuubwgr, buu, uu, wububwg, ugwruu, rru, wgrrbgg, gguw, ruub, rgu, ggw, rrwu, rwggr, rwwbwu, w, uuguw, wwgbu, brggw, rbwgru, guw, wub, gwuggur, grrw, wg, ubbguu, wgggb, uwb, uwwu, wrub, uwwgw, rubwbrr, wgbrg, bgb, bbwb, brgb, rwu, uur, bbruurrw, u, gbu, urb, wuwbggg, rwwrbr, gwb, grgrburw, bwrg, wbb, wuurw, bugbuug, uggrb, gubbgbb, bww, bbbw, gbwwr, wruw, rb, gguww, ugww, wgw, rgrwwg, gwbwr, brrw, bbrubu, rgb, rbwu, rrb, gwugug, rbgb, bgwg, gu, wwugguw, rgg, wbugrr, ubw, rbrru, grb, wrurrw, ggg, wbwg, rruu, ugr, bgg, ub, ggu, bbbr, rbw, bug, gggwbu, bbuu, urrb, gruww, b, uww, brbuw, urbubg, gugwg, bub, grg + +rwrurbburwbwwwwbrubbbwbwugwrbrubwuwubrbwbguuugguwrubgbggw +bgrurgbbwrbwgbggrruuguwwugbgwurbrbgbgrguuuurrwrwwgggr +gbbgrwbbbuwrwwubrgrguwwuwrgbrrwwrbggbrbuwuurggrbwggr +buuwggbwgbburuugrgurwbbwugbbwuwuwrwbbuguwur +uubuggugwrgubbwguugbuubwugugbwwwgbrbuggbbrrgbrguwuuurggbg +bubwurbrwwbwurbgburbwruwbgugwwrggwubuguggbgwguuububuww +gwrrgrwbgwugwgwrgrrwwbwwwrbbgrwbgwbwwgurubgggr +ruwwwbbuuuwuwgubbbgrbbrbggwwugubggugrwwgwubru +brwbwbugrwwuwbgggrgbruwugbgbwbuuwwwgwbugugurbugg +wrugrrggbrwuwubbwrggrgrburwggruwuuwwguwbuuuwuuwugrgwrggr +grrwggrrgurubwbwrgburgubbgbwggurguwbgbrgrr +ubbrrbbbbbbugugrwgguuubrgwbrgbuwbubgburrbwb +bwguwgrguubbbbwbgrrwbbgggggwgurguguwrbbburgwrruur +wwwrbggwrbbuuburrwggwuuurubbwwuuubwuugrbgwwurrgwg +rrrbuwuubgwgrrgrrwwgrrbbwbwgbbrwguuwbbwwgbrbrgrwgurggguww +uuugrgwruwgbbbrwwuguggwguwurwrgbubwgwrrrruuurb +gbgggwgbuwrurrgwgwbgrwrwrubbuuguuwrubrgrguggr +ugubruguwggubbbbburubwwbubgbgubguwburrubwggr +rwguwrubrggrruggrbubrbrwwurbuwrgurgwguwrugrrrwgbuwbggrrw +bbwwuguwwruuruwgguwbburbguurbgubgbwwwwrwuggr +wugbwwwugbubbwggbgwbbrgwbugwubbrwbggbbuwrbburggwwrr +bwuwugrwruwwrwrbwbuwbgurrgwguwgbgbbrgbwgwgrwgwrgggrwwgrwgw +wwrubrrgrwuubgrubgbgbwrbwrbwbrurubwuruubbbrruuubuwugwwb +gwugrbwuwrwwuugbwwbbrrbwurbbguwggwruwwwwrbuugb +gwruburwbggbgubbwrurgubrgburwrwguggbbruuwbbrguwub +bbrguwbwgrubuuruwgwrwgruuggwwwuubuubrwbrwwbburuuwugrgu +rrwgwrgugrbbbgrwuwrgbbrwwbugwwwurrbwgrubrbgugugrbbb +rbwwbuubbubwgbwggurwruugugruwbrguruurgrwbbbrbrgrbwrggg +brurwgrugbgbuuwgrrrrurrbbwuubwuruubrgbrugrgbruggbbbg +rubbuwwgugrurbbguubbrrbgrggugbbrrgbwuwrgbrrwwrgurwurwub +ubgrgwbrrbggbbgbuguwrbruggrruuggwuruubgguu +uugwwgwbrrrrgbwrruubgbwrwurwuuwbwuwwwggbuwbgr +rbwgbuwwgrgurbuuuggbgugwuggwwbubbugwgbwbgugggggwgrrrr +gguurubguwrrrgrwgrwbbbgbruububbrgwgbrugugwggr +rubgbgbrbrwgbuuwbwrwrruwwgugbgbbrwubwgbbuwbrgb +rugguwbwbgrwbwwuurgbgwbwwbwgruwrgurbrguuurgubrggrubwwwggr +bgrwrubuugwgrggrgbwbruwubgwrggrrwbwgbubgugw +ggbwbbbrbgwgbrbugrwwububrrrgugbrggbwurruwwwgb +brurguuwrrgguuwgruuwrwbbubrrgubbubbgwwgwwwgbwbrbwwbwb +grwbgbwbrbgrbwwruwuuwbgrrbwgbuwbugggwbrrubwgrwbguubruw +rugugrwrrurugguwgubuwbguubguubgrbggbgrubuwuwuguurrbgwbbw +uwbbbggrrburugbbbuugrrrrrwurrgrwrbgruggwgrgrurwggrrb +gbbbwrbgbrbgwwuggwbuggwwrbbwrwruuwgubbubggrrgugur +wrgrbgwbbugbgubrrrgubwwwwggruuuwuwugrwgbburuwrwbuwrgwbbgbr +rwgwuwbrgwurrwbubgwbgggguwrwwwuguuwuwuwwgwrug +rgwbwrubwrgwwgwrgwururgubrbwuwbbuuubbguwgrgwuurrbrruwb +wwuuggubrgrgbrbwguububgrbwugwgrwurrwbbrguwgb +rbwrrbrrubwuwrrwwrbbgurrwguubwrbbgrugbwurwwrb +wururbgrwgbwwbrbwbbugguwwwbugwrbgbbgrguuugbrubrugw +uuwgugubuwrbrwrrbwrbgbgurgrggwbgwrrwgurrwwwurbgbubwwgbwwgw +ubggrbbubgububrgwwubrwrgubbgwgbwwubwugwbwwgruwbgbu +ubgbbruwgbggrrwbuguurbwrwbgbugbwgbrbbuguuw +ubbgrrugbbugbwbugwwwgwwwrrgburbuwuguwrgugug +guwrubbrgurbbwwwbwguurruwruruwuwrbugrgbggr +wuggwbguwwrruggbbbgubwbgrrwgurrgrrwubrwgrbubg +ubugggwugurburgwuwurbrburbgubuwwrwwgbgwrrbggugb +bbwrwgwgggubuggwrgurwwuwgrgwurwrbwwguururgrbgbwbgg +ugruurwruubuwwwwrggugbruwwgwuwbbrgbbrggr +rgwbggbrwbgrubwbgrgwwugwubrgbrbbbgrubrbwbwbwgrbbwbuurrw +bwuugbgwububgrrwgrgubggrwgrrgrbugbbuwuububbrgugugwwwuuwr +wbuubwwgugrbwwwbggbrrrbbuuwugbgbuwwggrbbuw +bugwguurbggruwrrwwwwwwwrrruuggrbruguuurgbwrburuwrbwgruwwbw +wbgbwbrwwbbbrwgbbgwgurrrbuugurwgbbbwrbrbbwguggbbwggwrubwg +uruuwbwbgbuwrwguguuwuggrwwubbguwrrwwuuguuwbbwgbbubbrbwruur +wruwgbruugwbwuwwwwbwubbrrrrbwggrgwbgggrbrg +brgubuguwggggwwurbrgwbbgbubbggbbwugggbbwrwbbwuwbubuuuurr +rgwugbbruurwwrubgwugrrwuwuguwubuwrrrrbggr +bbwrbwwuwrwrgrugurgrwbgrrwgbbbrruubbuguwrwg +bwrbwbrgrrbuuuuguwrwwrrrbruurwrwwwwgwuubbwbrrg +grbbrbrguuguurgbbrwwgwrurrrwwrrbuwuuurgggr +uggwwrwwgugwwrgrgbgugwbrwuuggwbrgruburbrwrrgbu +uugbggbggwuuugbwwwrwbgbrrrwgwubwgwubrwguurbugub +buugbgwuwbwgguuwrwurrgwuwbbguugurbuwrrwuguurgrugubggr +gbuwrrwrgubwgrgwwgguuggbgwrrwbwbuwwgbbuuuwwbwrbuwbgrg +gurrwrbbgrwrrwwgugggrrgrgwuggbggwrgubrbbrrggrubbuubr +wrruwuggbwbgbubgrrrwwgububrgubuguwugrgrgru +ugrwgburwggbgwrrwuruwrrbrbrwbuubuurbwguguggbwwug +rwrubrrwwrrwbbubwbrgrwwrrbbrwwbrgbwgwurwrbgbwuuuuu +gbwugwbbwurugubbuggwbgurrggbbbgbrubbbgubbgw +wurggbrbuwwgwbubgrrruwurbruuwrrwwggrwgrbubgbwubuwrgwwwr +brwggruubwwuwwbgbbrurgrwuggrgrgbubgburggwrrrwbwwgwrgwgrbu +rgwrrwwgwuwwrwburuwuwuwwbgrwugrrgbrgruwurggr +bbrrwrbuwwubwwwuuuwbbuwuburuwwgrbwuuuubwwubgurwbgwbrbruggr +wrbrbrrwurrubwgwwgugrubbggrgruwwbgwubwurwwurrwwwgwbwruwbgg +grurrrwbwrgrbuwgbggrruwubrbbrrrwrrrubrbbbbbrrbbrbrwrbrg +bwbguwgwbuwugbrwwrurwbuugrwgwwwrrrburguubrrrwgbwrrrbuww +uggbwrwruubuwrruwgruruuwwggrgrwbwugwrgwubrrruwbbbugwrwgwgg +rgbwurggrugwbwwbggrgwuguuuuggrguuwwgwugguwggr +gurggwgrguwwgbgbgbwrgrgwwrrburugurguuwurbbgbuurbubuwwwwugw +wwggwuuuugrbwbgurwbguuwbbrwbuuwgguwwrwbgbgrgg +gubrwbwgubguururgruggrrrwwbrwuwwbguggwbbwrurbrru +wbggbbguuugrrugrruruwuwgwuuuwugrbrrwrrugrgbrwuwgwrrbw +ugbbubbbubruwrwwrbgubuubgwurugurguwgwbrbrgurubwrg +bgrbrubugwbuugwbwrrwubbrbwgwggbuwgbgwwuwwggr +uubgbrrbgwrwrrgwwrguuwrgguwgggugbrwgbuwuwwbru +rbgggrrgbuwburwgburugrbrbuwrurgwuwrgrruubwwbbu +gggwgggwggrgububgwgwrbgwwubgurubbrubwurrgwgugrubuwbwgwbbwggr +uwgwugwrbwwwrgrruwgggbwgbrbwrrwrbgggrguubgurbruwu +wrwgwuuuugrbrwubrwguwrrgbrubwrbrruggubwbrgbrub +gwbubburbuwubgrgrguwbwrrubwgugggrgugbggugrwrrb +urwgrwrgrrgrurwuubuwuuguuuwugrwbuwbbwbrrurwbbrbr +gbwbuurrwwrwbwwgwbubbrgruuuwruuwgwbwguubwrugrwggrrgggr +bgrbgrbbrrbggruwburwrurwrwrruggubuggugbgbg +urwubgwwgrugbbrrggurgrgubrbwurgwguurwurubwgrurbgwwguur +buburbbuwwugbwgubbbgbubggggwbwguuubbrwrwbruugwu +bwwrguugrubwurbwbwwwgbwbuwubbbbuwuugubgbbubgbub +rguggwrrbwuubuwurbuggrbrruwuubbwguguuwurbwurrgwwbbbr +rbubwugwuwwbwwbwuwuurbuwrrgbubwgbggrwbuugu +bbubbuuurgwggbbwubbgrrbgwwwwrbububwurwrurrw +bugwguwbuwgwrgwubrbrwubgbgrwwruwurbubbbuuggr +uguwrwwwwrwwrbgrbubwbruuwgggbrgrbrwbrrgurgbbwrgrg +gbbwrwuuwuwwrrgbbubuugbgrwbwurwgruwburrgbbbrg +rwbubrwubgbwgggwgruuwuwbuggburruuubgwbbbrgrubgwwgwrubbw +uuwuwuwuwgrwrubgbubwwbrurwurgwgurbuwwggguurwbrrwwrwwrwgur +rbwwbwrrugugrbuwruruwgugbguuwbrwgurrbrguuurgggbggbrrbwru +rrrwbrbrgwgrgrbgbwwurgrgbuubbgurwbwruurwgugwrgwb +grwrburwugbwrrwrgbuubrwwrwugruugrwbguwgbrw +wrbwwurgurrbgrwrwrgbwwgrrgggwrbgugwubugbgrbrbbugwrwuwb +rbgwrguguwrbggrgrugwwbwrugbrrguwubbugwwurrubrbgwwwuu +bbwuwguuggwrgbwrugrurbgwwrbrbuubwwwuubggurrruw +urbbrrburbwwbrrbwubburrruurrwwbbrgubrrrguuuubgwwbgbrbgbuw +rwuwbrrggrurrwrugwwrwbrbrgurwrrguwruubwguwggrgrugu +rggrugrggburwubruuguwrrwwbuguwgbwbuggubgrgrwuwugbgggug +rwrwwbwwrrbrurbgwuwbbgbrrwguuwbwwggwugwwrbggr +burgurrgrbrwrwurggbuubugubugrwruugubrbgbwuwrrbuuu +urrwugbwgwgwuwbbugrwurbbbwwrbwuwuurwgwgrbrrbgrwgbgggbbwggb +wgbuubwwbwwrgrrruugrbwwurwwrggubruwbuwrburgrwbbg +uubwwgrggrwgurbubggwuubwugurwwubbbwuwrwrburrwbbbww +wwgrrrbwrubbguruurrwrgbugwuwuuwubbgwgbwrbgwuuwwwwggr +wgwbgbwrgwwubwggwbbgwrrwgrrrwrwburwrburwugrbgggwgb +uruwuwbwuwwgrwrwubwuwwgggbbrggrbuwwwbuuubbubuwbggbrwg +wuuwgurbwrrguggggburubgbuwwruguwrugrrwgbbwwggrwbwbrugrbbwg +uburrugwrgbrrwbgwwwbwbuguubrubrugurubrbgggbbuuru +bugwubrgugrbwuwugrwwruugrwgwrwwrbgrbuubugwbub +ggubbgbuwggugggwwbbbrbbrwbwburugwurwrwgubrwrwububruwbwr +brubbgwgwwrrurbbburubbwwrubwwbbgurgwbwugrwrgrugrwuubgw +ugbuwwwgrugrwwrgwbgubrgrgwurrwgwgbrgbrgrgggwr +ggruugbwbbubugrwurwggubggurgbwuwurgwggburwbuw +bgbrrguwgggbbuurbugugggrwuuggwurwguururuwrrrrwb +uwrruggugrbgbgbrwwggbwggrbwugurbwwwurrwrgg +gwbwbubuuuggbrrwburrruugbrwwwwguwwuuuburwrbguggrww +wbwrwwwwgubrwuubgurrbubgwwrbgwgurwwwurwwrgurrr +urbgrbrbbuubwrgbrrrrwrrgugwurwbwwururubbrwbugugubugbwug +rwwbwguggwuubwrwuugrbbwgugwuwurubbuuwrrggr +wguggrbwbwububgbugrgwbuuwbuguwwbuwrgggbuwrgwwuwgrwwbgrggb +wrggwgrwwuburgwgubgburbbrgwubwrwbbwwuurbgu +gubwruwbbwbuwbbrrgbrbgbrrgwgruuwrurbruwbrgbbbbbuuwbbg +bbwgbwrrugrbwuubrwurwbgbrgbrwgguurrurrgugwwugwwbrwggu +rrbuggubrbwrrbggrbwgwgwbugrrgwbburbrwuwuggg +wrgbbbwrggbggrrwrgwwwrrwgbggrbuwrbrrggrbrggbugrwgggr +uuwrbrbgwbrbubuggggwruwbbggwbrrwwwbgruuburwbggw +wubuwugggbwwguubugrwwuubwgguguwwgbrwgurrwwgugrbugbbrruugbw +urrgrwwggrrwuwwuburbruurbwrbuwurbgrgbwgrrb +urwgwggwgugrrggurrbubruuwrbbwwgurrggruugrruwbrggr +gwuwbbbububrbwbrbggbbwbbgwrgrwbburugwuurrbgrgwburw +rwwguuwbbburwruwgrgwggurgrwguguggwgrrrrubwrgbgw +gggbbubgurbgrguburbrgrwwwrgwuuubrbuwububwuwgw +wrubrrrgwbbbubrwrrguwuuwgubwwwgrubrruurwrubwugbbbbuuggru +wbbbgwrwrubrrgrwbrbbrrwugrruwwrgbrrgbwbbggwwguuurwwbuggr +rwwggbwwgwrbwuuugugggrugbbrrwwwgbwbugrbrrgwrwg +urggbwrugrbwgwguwgbwrruruwrrwwuwgububguugwrugrbgbwggbuugug +gbrgrwbbbuwuuwwgbubbrguwrrgwwgwubbbrubgburggg +brgubugrgrrwbbgrgwgggububbbrbrubgrrrrwrruububrw +uurwwwwbrguwguuwrbgrurwbgrrguburwgubbbgbbrbbgbwggrg +ugbgburbrubgrbuwbrubbrbgrbbgggrgugbgbgwwbugwrwr +uggrrwwrwgbuurrurrwguugwwguwrubbrgurururruu +uurbggbuuubrurbruwurbbgrbgrbrbbgwuwwwuwugg +grrurrbuurwwgwbgrbwbubbggurguwgwuwuubrubrrrrwurgw +rbgugruguugrubgrgggurbbrruwbgguuggrrrrbbuuuwbrurbbggrgw +rrbrbrbbgbuuwubwguwrbgrugggrbgbgrgbgwuguurwgrurbgbwrggurug +brwbwbbrbbwrrggwgwbuwgbbrwbuuwwwubwggguwgruggwuggrgrww +ugwgbruwubbrgwgwgbgbgbruwubugbgruwggrguwwguwuugrurbgb +bbwrwggburgwgrwbubrrwugggubggurrbbwbguwwurbggrr +ruubbuwgrrwrggggrrgrbgbgurbuwgurguuugwgrur +ubruubbbbwwbruuurbrbugwbrrgbuwrwrggrugrwbwb +wrgubrwbgwbrrrrwgbggugrgwgubbggwrgwwgwuwubggbbwrwg +ugugrbugbuuwwugrwwuggrwggwbbubugururugrbugwgubb +gubgwububwwbrrwrrbugrurgbbrrgbbggwggbrwguu +rgrggwwugwwgbgruwgrrubrgbgbubbugwwgrurgwubr +ggbbuubwwbwbrgggbgbbbbwrrgubwrwgrbwbubwrwgwwbgwrbu +buwrwuugbrwgrubbbrbwrugwgrruguubwrbbgwrwrwbgbugrgrrgbbgb +gurububbrwgggrrugwbguwrgrbrrwrrbrruwrrwurgbbubrrwwg +wgwrwrrwuguugwwgugwwwbwgbrrrwbbbbguwgwwuguggr +wgwrwruugbuwwrwgwuguubbuggwrruwrgwwuuwrrbbbgwubuuuuwuubwbw +rwbggubwwwrrwrbwgbbwgwgbgrbbugrurgbbggrruwwbubburrbu +bwrgwbuuurubgbgwbguugbrrurgwrgwbuurrbbrwbggwg +uuugbbgwbgguwgwwgbbgurugbrwbgrwuugwuubggggrgrbrb +uuugrbbbbwggbgurrrbuguuugrwgubbgwuugwwubrrbwgwugwuwbbwgg +uuuwbgrgwbgrbrbrbwrurggbgbwbrbgrrwuruuwrwgbbruurrwwwbgbrggr +rwbguggbuguwburubbrgwgruurbgwrgbrurbruwwwurrbwbrur +urbgbbbgbggrrgrubgwrugwrwbruubbbgbrrrrbwbubuwggubbwrwwwggu +rwbuwgwgwwwuwrruwwwuuwggbubuubrwwuuwuwrubwb +gbbgrrrguruuwwbgubwbggrgwwbgguurwruubgwgwbbw +rburrgrbgbggrgbbgbrwuugrurrrrbrgurbbbrrugwbrgrrruuwgrbw +buuwuwwubbbuwubbgbuwwwwrbgrwrurgbrbrgggwuuruwggr +gbgbrugbuuwggrbrwruruuwwwgrwrwgwbrguugrwuwuwwuw +grbbgrrgwgrrubbwbwbwwrwrbgruubwwbbrgrwrwgggbuburrgbwbwwb +bwggugbbgwrrbbbbwrbrwbguubgruubggbuuubwgwgwb +wwwwrbgbrbwbrwwgugrugbwwwwgrwrugrbgurbrurbwrwrbugburubwggr +grruwwrwwwgrruuuwuwgbgbuwbrbwbubgrbwwrbwuubwwuwwwgbrggr +gwwuwwrbwbbrbguuwuwbgwbrwgwwgwbburwwgrurrubbwrwubwuggur +ruwurrgwggrrbuubbuwrbuwubrwbrbgbwwbbrubwgbwwuwubww +rburgwbwgrwbrbrbbbuuuwgwwrubgwbrrwbubuwbuguwuggr +uruggwruuwrgrrbubrgrgurwrbuggurggwuwwbwurugrrgwrruuwrb +wggwgwbgbbbgbrgbbbbruurrwwgurbuguwbbbrugrbrrrwgbguwuruwrww +wwrggwbrbubwwuwbggugrrgubruburrubburugggguurwugbwwuubww +rgurguwgugbgubrgwbwgurgbgrgbwbwgruuguwurugwggr +wgruwgrwurrgbgwbuwbububrgbwbburruwwuurbubwwggrwgrurgu +wrwurgrwbubgurrrbwuruugruwwurggrbwwguwwwuwwubbwgwugwuwuwuggr +wbbwgwbbgrrruubburbwrrwwrbrrbubugwuruwgruburuuruwrrw +bruwrbgbubgrwurwguggrburwrbgbbgwgwugwrrbww +grrrgurbwwugrubbrurgurugwwbgwgrruuwgubgurb +rwurbrwggggrbbbrgbugggwrrbrwwgrgggugbrgwrbgurwrbuwug +uwgrbbbwbwgggwwbgwgurugbbuwurrgrrgbwrrrrgburgbrgrbwgubu +bbwuuuugrruwgbbrburbwuwruggbbwbwrbrrwwubrrguubrwgwgbrw +gbrbwrwrwrrwwuguuwururugurgbuwuubwwgrbbbgbuwbgburrggr +grggbrwwrwubbgbrgrrrbuugugrrgrbwgbwbubwrubrrbugg +gbuggbbrwgrbgwrwubwggbwgbrwwwbbuubruuggurrrgburbgrb +rrrwugguwrwgrugbbugbbwwgrrrgrguwguuubburgubuwgbuwrrwrgbrggr +ubrgggwwbrbrbgrbrguwrrwguwwbubbuwubbrwuugbwgggrggr +urbbbrrgwrrbgbbgguuwburuwrurrbururgbwguwgbrgrwrwg +wubbbgrugwrubgubbbgwwwwbwgugrbrgubwrwuwwgwwg +buuubugbgwruuuurbuwrruubgruugwgbrrrrgggr +ggubwgwbwrwrwrbrbuurruwrurrrugbgburuwwbbwg +gwubbgrgrubwwuwburwrrwgbrbrbgwgguugbbwgwrubgwub +wrrgubrururgwgbwbwrwrrbuwrbrgbbggwbwggbbww +wwgbrggurbbwurbguuruggbgrwwrgbrwuuuggrgrbrrwrgb +buugrgrbrrwbrbrrwuurgrbrgbrgburgggbwburgrwggrgrbuubbbbb +rbrwwgrwwuwgwubbgrwggbgbwbwwrrrrbruwbrgrbgrgubburwrugurgb +wwbburgwgubgwwrwwwrwurwwwgbrwwgbwbgbgbrugwrgugwgrr +wguuwguugbrgwbgrgbgwbguugwwbrgbgbbbwwbuuuuguuwubbwgggg +rbwruururwguguwbbrrwrubuuuuwrgwwgurggrgwggbruuuugrw +wrgwuuwuruwugbggwrwwbwrbggwurbbbrurbbbbrbwwrbbrwbwbburru +brgrgubbbwrbwwubuugrwgrgubrwrguubuwbbrruubuuuuguwggrrgr +rgwbgbguwbububrruugrugrugrrgwubrgwbrguwgwbrrwgww +ggrbugurbbbbrwrwurrubbbuuubwgwrbrbbuuwbrrgurruugwrurg +rrbuuurbrbuwuwurubwrwurruwguurubgrggubrguguwwbwggr +uwbruggwwwwrwwgrwrwbgbuwbubbwbwbubwwgwbuwrbgruwrgbw +wwgwrugwwwbuwwubggwbubuwwgbwuwuggrwurwuwgrgubwrwgbuwurggr +wwbrrgbrbgbbbggwuwwwggruuugbwgwgbwubgwbrbwubgwbwurgwrgbggr +gugwwuguwwwruwrrwuwbgwgwwwrgwbguwbgwuuuwubgwbrrrwrbwg +brrbbguggwrrwwrwurguurwrrbgrbggrugrgggwrwub +uubbrwururuuuggwuwgbbbgbwbgwgwbbuwwbbgbrbbbwubr +ggburbbrggbbwurrggbrrwrrurrgrrguwrgubgwububwruwwggr +brbuuuwugrrguburrgwuugwbbrggrgrgguguguwbrwbwbbwwugguwwwu +uwgburrgwuwuguubwrgrbbwwggbuwrrrbbrbubwruguwbubgurbugwbuw +rbrruuuugggrubgbuguuubrugwwgugubggguubwugrwgr +ruggwrbrbgguuuugggurgwbbbgbwrbwbwwurgrwgguuuugbwbgwwgg +wgwbugguburwbwgurbwrbuwubgrgbwbwgbwrugurwuwwrwbb +gbrgwbggbgrbwguuugbggruwwbugrwrurbwbuubgguuwb +gbgbbuubburwbwbwubbuburbwurruruugwwrugbrbgwrrbrgruggu +gugwwuuguuguwrrrbwrgggbbuuwbgggwwbubbuubwrwgrrbrgbggurb +wubwbbwbgrwbwburwgruwguwwwubwwburubrugrbwgrb +wwuguwwwgggwgubggbgwbrbgbburgrurbgbbwbubrr +rwwwgwuugbguwbbuwbgwbgggrbuugbgwurrwrwugrruburr +uggbwbwuugbgbggrwbrwbgbrbgburbrubwurrbbbrwwbgrwwbwuggu +bbgbgrrwgrbuwubbwbrgubruwwbbgrubbugwgbrbwwgguu +wuwrrgrurubgwgbrgwbruggrubggwwgwgwgggrrrrbg +ubbwburrwrrrwugrrrbugwgwuggbbgbuubwrbwwrrgbbu +rurugwwbguguugruubwrrgbwbrurgrbrubuggwruugbbwrbb +bruguruwgrugurrggrurubgbuwuguwrgugrwwggr +bgwgrbbwgrrrgwrwbggrgurbwubgwgruurgrrwuurgbrguwwu +ubwwwbrbrgbgrbrbgubwrrgrgrburwurrwwruwwgrub +rgrrbrrwuwrwwgwwrrbrbwbbwbbwwurgrwgbggrbuw +bgrrrruuuwugubwbgguubwrbwwbugruwgbbbwguubwggugbgubrggwrw +brrbrwuwwrwuugurwuwrubbwgwruuuubgrgugwrurrrwuggw +uwgwggugrugrugbuugurbbrurrwwbrgurrgbggbwub +rubgbrguguwbuugbwwgbbrgwbwbbrgrwbgubgbggrrwru +guwwggururbwwgrgurrubgggurrrrgbgwugbbbburgrruwrruugwbgrg +buwgrrubrrubwgwuggwuggbruwwrgwggbwgugrwrwurbubgbuuwgugbgur +ugbwbuuburgrugwrggbrrgugwbrbbbrwwbgrgggbbwbubbgggrgguugu +buurgwubgggwuwgrrgbwurbuwwruwbbubbwbuubgwggbubbbbrwurrurg +guwrgbrbbrrwwgrbbwgrgbguwbuwrggrrgugbrbugguuwgrugrwurbuwu +gwbwgbggbrgrwwrbbggwgrrgubwubruubbuuwwgbubbgbg +urbubgbrbwwwrwrbbwrbgwbrgugbrwuwbrrbgbgwguuubbbbwggr +brbrrwbgwgwruuurggurruurwbwurbgggugburbuwbrwrguubwbwwwg +rbuugguwbbrggwurwrgwruruuruwbbrrwbrgubbuggbuuuwrwrrwuu +rwurguwrrbrbrrurrubrwuruwgbrbwwuwgwuurwrgbbuwrubgrrbrbwrrr +guugwuwrgwrbruruwwuuugubwugbbugubbuwrrgurwwu +wuuuwwwbrwwbguwwbggbrwrubuguwrwrwwwwguubrwwbrwuwug +bruguwrbbrrgrbbgwgrbgguugrgwgrbwbbuuugbwuubgrwrr +wwgbbubbrugwubrbwwbwuwgrgrwrwwubrgruuwggrrrrggbwrrrrg +gwbbrwbruubguubrgugrbgbgwwgurrwwuwruurrgrrubwururbgrgrwbggr +wbugrrwuubgbwwwbgrrbubwuwrgwrubgrbbwgguugg +gburwuwrrgwwrwbrgrbggggwuubuwwwuugrubwurwwbbbw +gwgbuubbwurbwbggugrgbwgugbubbwuuubbgggwgubggbwgrur +wgwwgrwbururuguwwrgrurrwuwrwgburrwgrwwggrrgbbrrbruwgbgbb +bgrgbrwrggwwbwrrurubwrrrgrgrgwgruuwuwrrgrrbbgwwgrb +wwuguuwrbuwburbubbgbgwbrurrrwgguwwbrrgbguwbuuwubggburbbuu +bwwurubgbwbgruwwwruwgbbggbrurgwuugrwwugguwgubwuu +ruwwrrrruggrbrbwrbrwurbrrgbwgwggubrburuwgbugbbwurwrrrrrw +wgubgrrggggguruuuwgbubrrbwuwwugbguwbrwuwgbwwrwuwwrrwwugrr +ggwugbbubuuurbwwggbguggrbrubbugburbuwgwgbbbwgwuwurugurw +guurwgrgrbrbwgbbgrrbwubgbgguwugbuwggbbuggr +rwuwbrrubggwbgugwrgbubbrbuuwbbubggbrggbgbruwuguurwwgwwrbb +buuubbwggbgugrbbrgrurbbwgbwurrgwrgwwuubrwwgug +bbggrwrurrwrgrrwruubbubrgrbgbbbbburrbruwgbuwrwgurr +uwubgwrrgbbrwgbwbwugwugbwbgwrrwuuggbgrwuugrbbwuubbbb +wurggubggrwggbwrurgwwugugubuguburguwgwwuggb +rwrrbgwbbrrbbbbwrruwuwwrruurubggugwurrrwubrbuuurruggurbrgb +bwwwbwrubwbwgbwwurbwubbburggbbwuurrwrrugwrbuuwruuwbrbgurg +rwugbrbwrubrrgggwgwwbwrrurgurrgwgugburruguuuwwu +brguuggbgurbgwguwrbwgwuggugbbwbgrguwuuuwrwubrr +brwguuwrgrwuuggwrubbugbwbgubbgrgwbgggurbrwubgbu +wurgruurbwuwbbrbrururbbwgurbbggwwgrubwuguwgrwgbg +grrbgbwruuugrrggrbuubrwwugbbwwurruwrrbguwurugurburg +rgrubruburbbuugwrgrrgggbwgbgugbbrgguwrgbgwbuwgwwwwb +gwwgwuuubwubwbggbwgwuurbuwruwuuubuugrurgbugbwrr +wrwwwwgbgbguwruguururwwubwrwwwgwrrwgrgggr +wwbururwwgwurwuwgubwrugrggrwwgruwwbbrwgbwrrwrggr +rgrwrbrwwbwwwubwgrbuggbwuwwguubwgrubwguggwrwgubwuurubwgbr +rurrbrbrrwugrwrbbrrggubruwrrburubuwbguuuruubrwrgwwub +bgurgrwgrggwrgurgbwwguwwrwgbruwwbwbguuuuwbrbw +wwuugrurbrurbbggbwrrwubwgbbgwbwrrwwuuruwwuwrrrggrbwugwww +gwgrwwrrubguggubbggggrubgwgggbruwgrwrgwrwrbwbgrrbgwwg +ruwubrrwggbbuuugurbwwbwbuuugbgbugguuwugrwbgwuguwuggr +bbwrurgbugwugugwuurgbggrrgwrbrubuguwbggr +ggugrbgwrwrbgwruwbuubggrbbrugwrbgwwbbgrwrrwwbbrwbrwu +bbwrbuwruuwuwwbgruwbuwgwbuwbbgrwuuwuguwgguugugrr +uwgugwgurbwuwrggwgbrgbgruurgbugrrgubwubrbu +grgguwrwwrruwruwrbbguwwgguwgbrgbwbgbuurguuwr +bwwggrgwrbgrurrrbgrbrwgbbwgggwwrbwubruwgrwuuwbguub +grurwwgwuugwgrwuwwrbbwrbruwguurbgguwwubbwgwwbg +gbwgrwgrgwgbubbwbgrgwrwwgugrgwubrgwuwgrrbgurw +ubrwwuwgwrgrgwgurwgrbbwwgwbgggubbbgrgwrgruguww +gwuwwguggrbbggrwrrrwbbwurbwururrwrwwgwubrg +wbguurggrrrwbgbwbrwbbubuguwggbwgbruuubuwwrbugbgbgbgbgg +rbbruggrruggwuwgguwuuwrguuubrubrgwbwrurubbwgwururbbbugurgb +rgrwugguubrbgwwuuwrgurgrrguurwbguwwgrgbbwg +brrwgrrurruuuwugurgbrurbrwrwgugwrrwwwbgururbrwwr +bwgguuwgbrwrgrbruwwbbguwwgbuubburwbgrwrwrrggr +bggugwuwbggubbbbuubbbguwurbrrubgurwbwrurwgbubwbbwwrgrgbbgu +wubrbbuwwgwwrrwgwbbgwwgwbgruwrgruuburbwrggbbwggugbwgugb +rrubgbbbwrbwuugggubruwgrubggbuubwwgubgrbrbgrrbbggb +buuwbwwbrwbgubugwbrgrgwwuwgubgwurguggbgguugbrrrr +grbgbubwbgbbgrwurwrburwgrggbwugrrwgbbbuwuwbgrgwrgrwbububuggr +ubwwuwwuuuwrbwuurguuubgrwgbwwgbgwbbbgburrgb +rrbuwgurbwgbuggggbgbggrbwrrubbbggrurrwbwrwgbgbwuw +ubwrurwrwgbgwbgggurgubwubrgwgggrubwbbggrwrrruwuwwuwrbgw +rubuuwrurrugwgrbbgbuwbrbbggwbrrrbuwgbgguugguwugr +guwrwbgbuguwbbwbwrguwwgbbbbrwrbuuburbwuwbuubbrggbb +gubururrrgwwuggbggrwgwbbrgrbuuburbbbguwwgu +wubguwubrbgbgrwrgrwguwurwggubbrbuurrbbbbwwuurwubuurbr +gguruwwugbuwguwgrwwugbguwuuugwwububwrrrruwgr +guwbwrbrbbgbugwgugwurbubgwrgrbbrwgrrugruwugbbwug +rbwuggbbgwbgrwubuwrbrgwwrbruwgggugwwwgbuwruuubwwuubwu +gugbbbwgbbwugwbgggwgrurgwbubrrwwwwrrbbbbrru +uuwggbwrrgrugrbwwwuwgwbgurbguburubwwbgbguuguggr +wrrgwgrbrbwuurwrbgbbbwwuwrguuwugbugwubwwuwgwrgrgrbbu +uwwwwbgurwubbwbbwrwubgruubwwguuwgrurgwrwgbrrrgbwrwrggr +wwuuggubbwwgrwubgurggrrwwrrbrguuwubgwrwwbwrurb +urgwuwwububrbwbrwwbrburggubgwgruubbuwburrrrrr +ubgggugbwgburbwrwrrgrguwgrugrbgruwurwgguuugwbubgb +wgubwrbwwgbbwrbugrbrgbwugrwugbwwuwbwbubggwb +buwbgggwwbwubuwwrbuwuggrwrbugwrruuguwrgrbrgrugb +rguubwwgrrbrbbuwrbgrguwbwwuwgbuuwwbbuuwwbwurr +bruubuwggrwuwubrgubwwbugbrgbrguwurrbwrwurwwggg +gwbgugbwbbwguwbuubbrurbbbruwwruugbwgwwuwbwuuuuwbbwwgbuu +wbguwwbbguwruurguwugugurubuuwgubbwgbbugrbbgggwubwbg +bbwruwurwbruggwrwuugbrwrwgrrbuwgwurgwbwgrrurbuwrrubgbgggug +ruugbugrubrrgrburwrbrrubbwgwwuwwrugrbggr +rrubrwbgruwubwwbrbwrwbbrgrgggugggwrgrrbbrrurbbugbrbrrb +wugwurgrbrgugbrgwrgrwwwrwgbuwbburgrbrwurwubrguwurbrrburuwb +wwbgurbrwubbuuuugbrrruurrwgbuurrgbbwuwuurrwwruubgrwrrg +uwwwrbgwubwwbwruwubbuggbuurgwwwbgrubugwwburrruw +rugwubwurrwugurbbbwbwbrrgwwuwwbuugggruugbuuguwubuwrrr +wgrurrwwwrggbrbubwgbbwrrbrgwwubwuugggbwggr +ubuwuuwgwbgwbrurrbrrbggwgwuwubguwuubgwrgruuurwgbgrgbbbrgw +rggruuwrwwwwrggrbgrubugurggrurrgwbuwrbuugwrwbwuuwrwwuwb +rwrgbugggubbwgubburwuurrwggurbugwbuugrwubugugwwruu +wbbguwbggrwbbwwurbubuwgbubrgwbuburububggr +burgwgbrgwrbbwwbuwrbugrggrbgwwrwwrgbgrbubwubwrwbw +ugrgwwbbbugbuubwurbwbrrguwggwgwbrurgburggur +rurrbwrgwubbrgrwruwwrggubbggrgugggwwgburbgrbw +gbwbwgbuugwrrwgwwuuugrrbbrrguugrbuburrrrbgrug +bbwgbrwrrwgbgrbwgrrurwbbuugwbwrurwwgwubrrwggrwwrrrwuwbb +bwbgrbgwbguugubwgwwrwbuwrrgwbuwrwgrrrgbrbwrbgwgru +wwrwubrwugbuuubwurwgubuggwrwgrwgurgwbugrururu +wrrbuurrwubwggwrwugwbrrgbrbrgbggrbgbgwugwruwwbgrwrg +grbwrgrbgwguwrbwbbgrbwrwbrgrrugbrrggrrgr +rugwubrbbrgbrbuuugrbguuugugubbbwugrgbwgwgbbrugubbr +gugwwugruuwbrrgurwwrurbwwbgggugrrruwgugbgguguruggbgwww +grrbguuburbbbwbrwwgugbgwrwguwbwuwrggwugbwbg +wgurbgbwgwbrurrbruruugggbwggrrugruurbrrwgbb +rggrrgbbwgburbwgrrbuubrgrbbrurrrbbrugbwgwburrrbbbrrrwwrg +wuuwggurgggbuuwuwrubgrwrwgwgwgbbrugbrrbuwgg +wrubuwwbbrbbburgrubugruubbbuwuuwrbrgubwbrgbgbwb +bwgruwwwuburgwbugbbuurruwuurggbrrgwuwurrgubwwgu +wwuwbuuwwrrwuguurburbuuwwubbruubrbrrwbuburwwwwwgugburwgur +rruugruwurbbwubrbgrwwugwugbruugugrrwwgugrrurgrwgbbgbr +rgbwurwbruggbgwgwwguurgggbuugbbrrrubwgruuubrbgggr +gbwgrgggbrugbrruuwgrbwrgwrwuggwguugwgwwburubuugu +ubruwrgbwbugrwuurgbggwgrguggbrrrrguggwwrwbgggwwbgb +wbuggrbburwwwuwgrwrgbwgrubuggugggrgbgubwuurbwgrbuwwuruubgu +bbbrwgwbgwbwbwbwuwwbubwrbbbgbuwgbgrgubguugugbgrr +wrbrgwbwbwgbuuuuwwrwguwubwwuuurrbrgwrugrgwrgbrr +brrbrbubgggrugurgubbwrurggburubwrwgubguwwrwbugb +guggurggrbbgrrgggguuwwbgbwrwbuuwwuguuwubuwbwgubbwguurwb +bwgwrguruwwrrrwwguggwubguuwbgrbwwubwgwgwuuub +rbgwuurgurrrugwuwgbbburrbwwrwgrrgbrwbgwrbrururuuuwugwbgggr diff --git a/solutions/alv67/day19/test.txt b/solutions/alv67/day19/test.txt new file mode 100644 index 0000000..29648be --- /dev/null +++ b/solutions/alv67/day19/test.txt @@ -0,0 +1,10 @@ +r, wr, b, g, bwu, rb, gb, br + +brwrr +bggr +gbbr +rrbgbr +ubwu +bwurrg +brgr +bbrgwb