Advent of code 2025 (not proud)

Compare changes

Choose any two refs to compare.

Changed files
+1941
day_3
day_4
day_5
day_6
day_3/3

This is a binary file and will not be displayed.

+60
day_3/3.c
···
···
+
#include <stddef.h>
+
#include <stdio.h>
+
#include <stdlib.h>
+
int main(int argc, char* argv[]) {
+
FILE* f = NULL;
+
size_t size = 0;
+
char* line = NULL;
+
ssize_t nread = 0;
+
+
unsigned long long bat_sum = 0;
+
+
f = fopen(argv[1], "r");
+
+
while ((nread = getline(&line, &size, f)) != -1) {
+
unsigned long long bat_n = 0;
+
int number_of_batteris = 12;
+
int b_i = 0;
+
int a_i_1 = 0;
+
int a_i = -1;
+
int b = 0;
+
printf("line: %s",line);
+
// go through each line (we can keep as chars) get the largest number, get its index,
+
// go through second loop starting from that index, get the largest number there.
+
// i love loops within loops
+
+
+
//generalizing for n amount of battteris
+
+
for (int n = number_of_batteris; n>0; n--) {
+
a_i_1 = a_i;
+
a_i = 0;
+
int a = 0;
+
for (int i = a_i_1+1; i< nread-1-n+1; i++) { // we dont need line end char i think., and we cant choose the last one since then there will be no place for the second battery
+
if (a < line[i] - '0') {
+
a_i = i;
+
a = line[i] - '0';
+
}
+
}
+
bat_n = bat_n*10;
+
bat_n += a;
+
}
+
+
+
+
+
+
+
printf("digits :(%llu)\n\n",bat_n);
+
+
bat_sum += bat_n;
+
}
+
+
+
printf("bat summ: %llu\n",bat_sum);
+
+
+
free(f);
+
free(line);
+
return 0;
+
}
+200
day_3/input.txt
···
···
+
2213322222223222132231233322432224423222226232323522232215252332221122222231232224232722131522422232
+
9869755494885236452767647548826258555668838497687557968652485746757835445145546687436356799481798587
+
1333642233323333373233223535543332333343733333323333333333315334333323343343333333332321233332333333
+
2412331232332223332211413223433332213222252142221323322122212223222321231322513323122332321233233222
+
7233333554333634354333355353442655334523373532334435335733343124433353732333236335456441345343535443
+
2542623755573343945454412366525442424744334132133146357442166333737542732631343535567546644733453327
+
3223423125721322245221313311333222222222322321672232321322215121332232323522331112523842131211222231
+
1341524443834221222553325236443534253327533543493534348242333119334424249244524325448544522322512344
+
2122222234421423322222232231221455261322312321232223321232322112233222233223322222121221322232225222
+
2172228252452422574523272252246532513514251543422251252233622213162235313243341322723224223472223342
+
4333333322374312333333442252233332323343236421333332132232233523333223643444244332233333333314343374
+
5564564445425635543326425252871657266475435535644335444428545455444345414454654413464444444543452332
+
7454483454246843436686564547347643444463364743844643844454433455547944454424656442455444258453453949
+
3545239364734434356884585159793673287754643667512332857278643456465359873642643268698837552366444279
+
2222614212122412212232521222222222322162224122212255224652222252322242352254132522221123221222222222
+
4654734524468553536655551947342343744798353537531365525555255373383337465222438553556563343546674795
+
4223343232434234223443433132443232333433233241333323334444234334443434435341513522333132223342423334
+
2434743225152133244934233332223333342332742413225323434322133133342225263461325222442331344323333621
+
4363333625436326121432327152115232112437232426739557622735333213153454854223553223332333163322332262
+
3291224524551531661124222122232433443332372352223452323152254212524224475353217335338132112225138382
+
2532334224334412444233531343333232434672372334424223232433234233235242243334444434532142565432224543
+
6575467444354636644724356545439443727633232211663455734655446347433346552413539455535454456546344467
+
2212123522212256112142223212223223926221423333322111142121322246521222623231121222222233122682282232
+
2427422153354454221223483334425221233131444333342323144413423342141422222343422242225233412322852334
+
2223222262222351122221222542222356232422221312224223222121224242221142612223533222222326212112222231
+
1122221221423121122222221122242426222322222218222222222122222424232223133224227122232222225212322431
+
2223225222263221223122232222231322132249422122222222212343223233221231112333321122224822122212112221
+
2234133242122472222333323231152222313322242231321234122233314332232125212342222222141222224223222243
+
3222421121132228332482223722323212227931233222232311122728212342422323911121332241322122212225222224
+
3342221445144453253254314734532247546356242543223144334535244724343441632342442234353332554531544544
+
6644254436227552262158566262526533915631231552333722416565536354544652263755643341664563253253335325
+
2212221212221266252415512232524121224221462212225225525255242115212235231241252544312222525112533222
+
1212222242222222122121231123212212232222221112225222122222212212222222222322221222222333222222232121
+
8437515934322544325244332733235426312213422543233274311523432242324234425333225643164333335325158723
+
4955559385766953565255766876476558356667683243721462495465455956585541549636358359356553352726754357
+
2321212231311222332231233622451222223233632131325333155422313242233246235373323463222222233151352225
+
5554455544442245353244364445444442964455743554423443344234626245334485444521454444353644544434348444
+
3584546435435438362463553335553744339333343334752434593543434442333333333374362737434422835322244974
+
2224322223132222332322223422213222223821212223222243223232222232232222362222323122422922222223222321
+
7532213233323334215212222423122123222322425222323732234174212342242222239222238232423135916233324313
+
4725333553331231732334534535433413336333334433335633862233333333343434333253574633253313333533322533
+
2222122222233222222212322321212122221322122123122322232112231321222234222233122122113113222142221222
+
7618667762444757529352444283355721866946122758937266864545275866446765437263255944277544354266743555
+
8775885395735793768798676737467545866325994734656888365669834844567693699478564767598836687838775796
+
2323222163231422333232265212225222433552125522231421223232222242111255222111234232222234643453222212
+
3212222223211242222322222423924221333231242222215221222222222412222332242222342226222112342222222423
+
2312517442152222775232225322152322134642256726212312232253122631232442222322774322261522237322225221
+
1412232232122132322214222245123232224232423122523323323512434322222122322223232324512223213223221225
+
4624745444557739264643334474753442344576454464364444542355443444953574753765466446534445555247546645
+
4444445543553433353354455144453453542444435444454565454246452554274346433345434464454144453534444454
+
5222221211223232461222322221422324122212222121524122122224222221222226222282222211433212232262313272
+
4443424217342232322234144234322244432422332123432122562423442343241152444222734444343343324245233331
+
4625363444334325314433134332342626273324257534444232232533221335211222233354622142319633834554323252
+
6411222232214222222522522212115422324312321212512352222222222521221222222422213215222323222542332225
+
4443435744444443443454344444553646453444473243634337443343333445443444444444544642353434424344143344
+
4222322212142222131123232424122212623122325223232222122222324172123313113213221112221214131212326232
+
3628228272226822792212222291522222262281252222222122523312222224388323226222431232246223822272242222
+
6452232522272722232314236322514222212124422122363122133442752472323254631272561324232244232223412433
+
2232232212252263221723231243261132732225353342123222262123232223621135231232353226314132222321322523
+
2234532142534352552432224445238325213424373452334233522333242532331322332283352427475226322153223244
+
9472212243122222252422922222363422333321126243222123963224222212173222233224252234412121222122821213
+
8687898777877956884675896696763989727598788596888366975787785653266667396852928885385879777658746578
+
4742438327346661542272567435214432666247432532364464374423432252594887642242783264284248334549366538
+
2843543444552553332333549456453152452655123452245534625343434434394353525145545815233325253353558525
+
3244334344333322333336326524543522543353334524333542335243334463433424253344265152434334435422433433
+
5123213122132653223552342918633223322124141221532722222222633832112321232362321212223224311252232323
+
2254522224536212312521242224331285151323234522312332222153222222233213252422324212324255413222233635
+
6932637327758743246546437713551343621222422345652667325366263533277364672223242653614462113113621452
+
2664332353263783333136373783525676334732434213262462433235335292339233763346833362333754633332336332
+
1223222424223252223213121222322322216422412224222612422223221222312122222125212222415122232226422521
+
3542584332435333333233354353545344224553534123354453332523352334552335453523343512333213234387634133
+
6477957673773844477447976677777779677788757572445797735766653875666759654537677675353627655576767927
+
2122863223233922223222231121222335332223122512323122233223421212114232222322232221223392322222521322
+
4312524534123246451432343643224311242447241134644264223443332245433262232641376442432172472222642235
+
2275325124326274246343242342674425241126422624221639763313155173323211554216434553212654542522244512
+
1538376354635334634345152866523443431672342341845227336436433755352916223414454255126676464326465453
+
2462132262212214732224191166344355414456333232523325425323262172634333344212243223136153134622523124
+
2631319623233673572328447522142326723725312315363222557334327382237347133534333342445538226351733877
+
6674525765645736755277426478666374433478565771746335482576661384446336527753576379765114777324835247
+
1445214354534443124443143152322124342543358432243223532332224344453244325421233463452464443336435444
+
3723543344762463142452771243123333533262534743357433433442333434323237223413433322343122246434425297
+
2522212232142222322222221222222123222513232222522212222241212423221222221232222422123182421222222352
+
4649425575652455655345524446535555664456453353551334555552535554525353745544253454663345473375355545
+
2634673446446644485645555244654443495523355587664334545525752374784735443457755455456485493456463553
+
2242233312853232212222233154124241433323223342432114322372333333333232333133312323424253242333222527
+
2252222222122622131222221211221252222222262122342222322122323222252212223225224113322222213227122112
+
7145153421321212213232213242421325372523143232242542622222334162232643213463222315224332241623233632
+
3324124233321322222222324392322321322222222224223432342142234421321364212212331212326242323313313333
+
2472266245644522634774327358522262635513323335182372254462662143946277975225436422277562365266655423
+
3454443243442454643335544534416344433344445654442214445434214514463442433444324544444345444345543344
+
4367979552245565165576424776225962637573364823785465568368636312742298786276647827575676469244525653
+
3225626443313133323723323323333314253554364347343365333323333336333733232322233333323433327322332332
+
2573343343233434433434335363345452556353493431488327365413335557454378339752343364644435453325754543
+
3332172133227223334324253377332133233323223333532233333322112735223232322223234272123323333632212223
+
3454534475343444535444424745434444444344455444623375454534443434344544444438232474343544535454434444
+
2644342235344483342633422636454456365233515643444645826444442446956214445156322264445433443453544256
+
2223435334423434443323343432344434441333333333334433523433332124432343243433314444324423343343444233
+
3212252222442321323221225293213122528329522211182223418222232142225234221221222222423222321246232122
+
4353432493542334325235547332734383332234542144323893258347384435444429271453353353448434142247423122
+
8337935245577558348845559668464454534353766484438335543755757443777274244484345834388345496944455467
+
3443463333334453433232243443222334133233433234432324222432323533323324433242132332332124242343233322
+
1435542554154543564533441335544555244531645445572234345443345431434433534143565444437433564233354423
+
3333312334342233331223233234233423333333333222332233423337233233333323213132222322314332323333244443
+
3144453439443334333662444343463453336433435352354493435346436453383544432444466337453337853423233436
+
2621273163344422333343232136211636224222434231116342222542232213433324642324241176224342723221422332
+
3233236263233353563335231233252323223521334126123623332512327322312223333223215221283522467362232326
+
2232223222222222223224222222222221221211221222123322422321223212222221322222212221222221222222342222
+
4443435431454234435334436543423453441422434424434246438432132274643321323342524533232532212314424334
+
3434222234424123524222452333431221233121324331412242454221434433122432415442443243322313221343241245
+
2321552222525121432422322331221528511324222222222223251323221222325322125252122222212222223233125422
+
2113322212122312221212122222122232221222332422312233422223123112132122232232231222235122334122222212
+
3732434222332433314434542433334343433225344323314343343423334323322433232435323333324234332413313341
+
2243352221342443222271236434365322934422234223125222337624122643272322622437441322243413243473882412
+
2527574826427351353683632227267232139241272336778354926836323453363482545233625417243233594635373371
+
2352124323843333323253365635322233542433122438331432234333233233552321434213213222343343494522232371
+
1322321231222372222321132512312222322322224462222223322222222221223222233121722212522142211233221233
+
5444455244355434653244514353733425555432435524445462355644544453443433445226446336553853553454444444
+
3332233333334338391321272312134322233863322333432334333383232342334223332333234786233333432424325933
+
1423223524424321433522322244232223331233231333313336222333934223422133232353433212332232224322322433
+
3846414434329535333324434434463744365584534935533343538345434362733943434244645366346976364533243345
+
4643437654442357354452643453433595563365355434644545556753685648354446745633345454324745655324554344
+
2131424213433334334241312123344324133131413343442431244222441243341422141411322341334123242221356789
+
7416322321423422532433252263461535237341336423224758925417544133763249354532465584557477436637134868
+
3532232342543633244356234447125413363324323324222289345334243223343344349423623323132345434545334456
+
2222222223122224523322222414412221222312521311252212471135216121622212122422823223224222252322223322
+
6844572852724766364376246428458471423425425655656355452483274422366737555436524246373644225524226684
+
3242324353115355355323223333323433133532332325223553622433333532532333223134223363333333733357422553
+
3626353353644274241533142456273326314323662575363324353232556433624425644535422316323346623244545532
+
2724454534154225253459433524763422545426423332642224232423242219414234215362382511227546231223755232
+
7442133222243344231433423324322522433233342443244242433423242443424324213224132442463664334134342334
+
3463633243546333375266535312435244564434333724665664625374363683533955743535443448446155363433352435
+
2264222222213232253131424222232214292212282234282122225323422451223621252222122222122222532326531252
+
7615864866564643665565345652664464866686665436644563376466655765566766633576745646454764727756626448
+
3232682631537442445212595232662334363343227323835122465351345356353233643332543416323346345346643365
+
2477354147362541612246656262342473335717542264534245221467537422444573332674431531423425215312544289
+
2334432533153324242344341754352431132342242483614364474473434824424423481248441342313143738143793223
+
2453444254242142424354527214334534514423135772455224332544144347235744422234224425443544453243344614
+
5212223252122422331232123222142312233422245334462222222225244224221242232221512243232224234433555222
+
4663361654535434444435333426543336213653424435533654435334427263236324336542736224533733545413433239
+
3363338333145338474323437333462332324223453341452444327323423238343353864322373218432131334133331333
+
6252146332321485753632148626252215423622661447732432532425663473353884553422633662223652246821433466
+
6323212434222112525725474243264325545472241252227222635137276274422143227243432646722261633476517122
+
2292128532222284521512222622221222422421324224222681233623522223223262427233231272222123235231221181
+
4286246955215254312515631624225942342242521826335223234535339245216232525515324431229213242425522424
+
2622122232123521122122322223322225522212213235316222222233213212622122172232222411222222312122211732
+
2392322272325242232246227222232731732621613276422282332227135645532724216422152724335327741242231462
+
2133344331342334353334326416233445424328334428226343632383533126256345224276253624433232223322429335
+
1313445155233335142345133432424315243344534322414122115152312323134555232124514425531444334531116789
+
2176422423121432443422442232123322224224142721224212222312511322231432233234223323244211222332222122
+
1323212331222132233231423322222222214333233212344223434312442222492221354321222342223332373533322621
+
4664434362444745561444535453345435524434346435454274864444654324476633565349444454455353443364156363
+
1638584275546117346163717254773527552852888544638242767347444874466266733617618166164466374362765419
+
6484454656734464566656446354242553953738747675494353263545534655932284732414565465456217445446466422
+
3485414422321524833475231333422824247332244623522414142222262253355414452434234344554242224422224624
+
2333263233433521134582215333224332925436375333333336732316531375333522444212233753383365335354643243
+
2322132222223221323111333232222233332322122232221312232253222222232322332431323222322231242312325223
+
5335322444334334442443232426223323234447129221322222234335221422223321222322222324423233342232233364
+
2233232223252234233222422323332233122122213133422132233223243122322122142422223322242222332521212211
+
2243222246232222212215234223244341293823233413422262122231434142334224211122243244723212111327343722
+
3313433324333323233333323332233423333523353312313633334213233333425232634123313333625322322224342122
+
2223221221321122424222323113232211222413233225122222222312222222225361224122154344233232252313223232
+
6426445154869355363363722336455335472343572534323456253645532493615956527636643453556642545246266326
+
4342252241221222341214232232226432422223222214311224253224847131242221312222431142152243223533228364
+
3122222221312333212221331241133322212322122433312122322332322212332222212322222142232224224432241333
+
4758777554587868737644678898656677787655757385768789874455858856835848887478458889776575587488744887
+
2222222322222222132444434221222223222211212222421221422124222221223422331422622421122212232221222222
+
5543453232434923234235323433433652346343532235133533353325643323414321344433315332531344244423332533
+
1422222221222222212122311222212124122222322232222122112222222222122221212242222322212222211512242221
+
5624318328343613762342133122287362233222333228233526432235723228212317225232222321322843831822233343
+
4745555462555745374333447645563565846565658565674475358542453455774373535925543556456253364455655565
+
2231323341221332332231232222211222122232242312343424133212222221221623132213242312314213213122222113
+
2342415122621132242242322221225542255222222222112241222232223222323213522222122246221231225232243224
+
6223131445352273462225532517237771421222422217426141752312626563272261233221417286234434252324661125
+
5222222212212422212223223322211422113212222441222322222222432222222222222222132132522224131242222451
+
3422323526233255413253234422122625354565276426242722342264341342322432242227231221345261423232251243
+
4455444352444254693544224343146552455424553454457554355354334375444452434455453544443455535455225454
+
6695865665676765678566666576961755966654564567555567567556642646397966556665359666465757356556757769
+
8357544347353366537753222233513443263326227543433534321424453266343553435425423918643343433235261323
+
2222222222222221222113122221132222411225322222222222222441122332222222232132115232313221145522221221
+
2224124212242232553331122222231252712234224682324732533127244253223113212252422561212242222267412142
+
2155131243437642435225242233334327262528545127324323242251223242215932221342512431224563331215223232
+
3233233821422242243223423226322333331221244225322333614732324322164332232342254245324342223324333333
+
5323233433722283363642223343334264332334256668558433344333335344774523223633116853423338533332265733
+
6636218835567665856535755855763526554865876567668671763558535573733875754666654864563576447378687647
+
3242212222532222453222221222221414445243225223253221212124423422213112225222222212136322222122223223
+
3246242324335263534434465364444433354444733144444444634444442415237463482176214523646425165642842254
+
2222122121452242222112223321223211222122412432421222323122222422224234323112221412442225322222244223
+
5555533353644375536354623527576345645257454546563754453235344566547743535526353443675773695567647537
+
3333334233422333245534448312255264263533563132333625233423334335232332233333924442432512333355242243
+
5335324246344212334344347222166443335324633214664133136352235644245321635434234446546333352834514533
+
3232232233742222122234123363441422152241262422235221425422492124252122242244323222152522222164124334
+
3462333528242224232212331221524224225335332337777262223233218633225162762134332832833282226832233352
+
2632332326122221121112263242232222122432223221342223342224123122112324132321112262322121522112113221
+
2643223122321323333222122131322331333331122234423732236222323333323223232221311311224272231332243223
+
1222223121241124122212232223223222122522221122332123122232231322212311251223333222513332338312123112
+
2152323434738233433164425517324546331332242235424332433322422413432633344543243344744343237342432312
+
4131322231422253332322233423433322322232222122431221333113333223333234213123233223231323332233334323
+
2463363425242612416264341654545345115236122326652335252424331225332623114245461624526144136446312789
+
5832235534333334323334233312133213343133323333875344483233343683364244333343536273324539333242273393
+
5336252424463368242344342182144524854253313325351235445322225455244424225253125634815634443442624924
+4
day_3/mini.txt
···
···
+
987654321111111
+
811111111111119
+
234234234234278
+
818181911112111
+134
day_4/4.c
···
···
+
#include <stddef.h>
+
#include <stdio.h>
+
#include <stdlib.h>
+
+
+
int get_acces(int** matrix,int i,int j,int last_i,int last_j) { // last_{i,j} are bools to indicate we are in the last row}
+
int neighbors = -1;
+
int i_0 = 0;
+
int i_last = 0;
+
int j_0= 0;
+
int j_last = 0;
+
+
if (i == 0) {
+
i_0 = 1;
+
} else if (last_i) {
+
+
i_last = 1;
+
}
+
if (j==0) {
+
+
j_0 = 1;
+
} else if (last_j) {
+
+
j_last = 1;
+
}
+
+
// for step 2 we will be working modulus 2. during the run, once we establish a roll as accesible it will get replaces with 3.
+
// while counting it for the neighbors it will still result in true for %2.
+
// once a run is over, we iterate over the whole matrix again and reduce all 3's by 1.
+
for (int ii = -1+i_0; ii<=1-i_last; ii++) {
+
for (int jj = -1+j_0; jj<=1-j_last ; jj++) {
+
if (matrix[i+ii][j+jj]%2) {
+
neighbors++;
+
}
+
}
+
}
+
if (neighbors<4) {
+
return 1;
+
} else {
+
return 0;
+
}
+
}
+
+
int main(int argc, char* argv[]) {
+
+
+
FILE* f = NULL;
+
char* line = NULL;
+
size_t size = 0;
+
ssize_t nread = 0;
+
int len = 0;
+
int w = 0;
+
int access = 0;
+
int accesible_rolls = 0;
+
int total_accesible_rolls = 0;
+
+
int** matrix_ptr = NULL;
+
+
+
f = fopen(argv[1], "r");
+
+
+
while ((nread = getline(&line, &size, f)) != -1) {
+
w = nread-2;
+
matrix_ptr = (int **)realloc(matrix_ptr, (len+1) * (nread-2)*sizeof(int));
+
matrix_ptr[len] = (int *)malloc((nread-2)*sizeof(int));
+
for (int i = 0; i< nread-1; i++) {
+
if (line[i] == '@') {
+
matrix_ptr[len][i] = 1;
+
+
} else {
+
matrix_ptr[len][i] = 0;
+
}
+
// printf("%d",(&matrix_ptr)[j][i]);
+
}
+
len++;
+
}
+
+
// just a matrix out of input.
+
+
//
+
// [(i-1,j-1)][(i-1,j)] [(i-1,j+1)]
+
// [(i,j-1)] [(i,j)] [(i,j+1)]
+
// [(i+1,j-1)][(i+1,j)] [(i+1,j+1)]
+
// check all of those in clockwise order
+
//
+
+
do {
+
accesible_rolls=0;
+
for (int i = 0; i<len; i++) {
+
for (int j = 0; j<w+1; j++) {
+
if(matrix_ptr[i][j]==1) {
+
access = get_acces(matrix_ptr, i, j, (i==len-1), (j==w));
+
if (access) {
+
matrix_ptr[i][j]+=2;
+
accesible_rolls++;
+
printf("x");
+
}else {
+
+
printf("@");
+
}
+
} else {
+
printf(".");
+
}
+
+
}
+
printf("\n");
+
}
+
+
+
for (int i = 0; i<len; i++) {
+
for (int j = 0; j<w+1; j++) {
+
if(matrix_ptr[i][j]==3) {
+
matrix_ptr[i][j]--;
+
+
}
+
}}
+
+
printf("\n\n accesible rolls: %d\n",accesible_rolls);
+
total_accesible_rolls+=accesible_rolls;
+
}while (accesible_rolls>0);
+
+
+
+
+
+
printf("\n\n total accesible rolls: %d\n",total_accesible_rolls);
+
+
+
free(matrix_ptr);
+
free(f);
+
free(line);
+
return 0;
+
}
+136
day_4/input.txt
···
···
+
@@@@@@@@.@.@@@@.@@@@@@@@..@..@@@@.@.@.@..@@.@@@@@.@@.@@@@@@@@.....@.@.@..@@@.@@@@@@@.@@......@.@@@@...@.@@.@.@...@@@.@....@.@@@@..@@@.@@
+
@..@.@@@@@@@.@@@.@@@@@@.@@@@@@.@...@....@.@.@.@....@@@...@..@..@@@..@@@@@@@@@@.@..@.@..@.@.@@@.@.@@@.@@.@@@...@@.@@@.@@@@.@@.@.@@@@.@@.@
+
@.@@.@.@..@@@..@.@@@@@.@.@@.@@.@.@@...@.@.@.@@@@.@@@.@@@@@@@@@@@@.@@..@@.@@@@@@@..@@.@.@@@.@@..@@@@@@@.@@@.@..@@@@@@.@@@@..@@.@.@@..@@.@
+
@@..@@@@@..@@@@@..@@@.@@.@@.@@@@@@@.@@.@@.@@..@.@@.@..@.@@...@@@@@@@@.@@@.@@@.@@@@@@.@@@.@..@..@..@.@@.@.@@@@.@@@.....@@..@@...@@@.@@.@@
+
@..@..@@..@@.@@.@@@@@.@@@.@.@@@@@@.@@@..@.@@@@@..@.@@..@@@.@@@@@@.@@.@@@@@@@.@@@@@..@@.@@@.@@@@@@@.@..@.@@@@@@@@....@@@.@@@@..@@@@@@.@@.
+
@@@@.@@@.@.@@.@@..@@@@@.@.@..@.@..@@@@@@.@@.@@@@@@.@@@...@.@.@@...@.@@.@.@.@.@.@@...@@@..@@@@...@.@.@@..@@@.@@@@.@@@@.@@@.@@@..@....@@@@
+
@@@..@.@@@@@@@@@@...@@@@@@@@@@.@@.@....@.@@.@.@@..@@.@@@@@@@....@@@.@@@@.@.@@@@@@@@@@..@@.@@.@@.@@@.@.@@..@@@.@@..@@@@.@@@@@.@@.@@..@@.@
+
@@@.@@@@@..@..@.@..@@.@@.@@@@@.@@@@...@@@...@@@@@.@@@@@@@@@@..@@@@@@@@@@@@@.@@@@@@@@@.@..@.@@@.@...@@@@.@.@.@.@@@@@.@..@.@.@@@@.@.@@.@@@
+
@.@....@@@@@@@.@.@.@.@.@@@@...@....@@@.@@@.@@@@.@@..@@@@@@@@@@.@@@@.@@.@@.@@.@@@.@@@@....@@@@@@.@@@@@.....@.@.@@.@.@@@.@.@@@@.@@.....@@@
+
@@@@@...@..@@.@.@@@@.@@@@@@.@...@.@.@@.@..@@.@.@.@@@@@..@@.@.@@@@..@@@..@.@@..@@@@@@..@@@...@@@@@.@@@.@@@.@.@@@@.@@@@.@@@@@@@@@@.@@@..@@
+
@@@.@@.@@.@@@@@@@@..@@@.@@@@@@@@@.@@.@@@@@.@@@@@@@.....@@@@.@@@..@.@@....@@@@.@@..@@.@@.@@@@..@@@.@@@.@@@@@@@..@@@@@@@....@.@.@@@@@@.@@@
+
@@@@@@@...@@@.@@@.....@@@..@...@...@.@@@@.@@@@@@@@.@@.@.@@@@@.@..@@@@@@@@@@....@@@@@@@..@.@..@@@..@@..@@..@.@.@@...@@@@@..@@@..@@.@@@@@.
+
@@@@@@@@@@@.@@@@..@@.@@@.@@..@@..@@.@.@@@@@@.@@@.@@@@@...@@.@@@@...@@@@..@..@@@.@@.@@@@.@..@.@.@@@.@@@@@@@.@.@@.@@@@.@@.@@.@@.@...@@@...
+
@.@.....@@.@@@@@@@.@@@@@@@..@@..@@@..@@.@..@..@@@@.@.@@@@.@..@@@@@@.@@@.@@@@@@.@.@@@@@.@@@@@@.@@.@@..@@@@@@@@.@@@.@@@@@.@.@.@@..@..@@.@.
+
@@....@@.@@@.@.@@.@@@@@..@@@@@.@@@@@.@@@..@@@.@..@@@@@@.@.@.@@@@@.@@@.@@@@@@@@.@.@@.@.@@@@.@@@..@@.@@@@....@@@@@.@@@@.@@@@@@@@@.@@.@@...
+
@@...@@@@@@@.@@@.@..@..@@@..@@@@@@@.@@@@.@.@.@@@@@@@@..@@@@.@.@.@@.@@@..@.@@@.@@@@@@.@.@@@@...@.@@@.@..@@@@@@.@@@@@@@..@@..@.@..@@.@@..@
+
@@@@@@@.@@.@.@@@....@.@.@.@@@@@@@@@@@@@.@...@@.@@.@@..@@..@..@@@@@@@.@@..@@@@@@@@.@@@@@@..@.@@.@@@@@.@@...@...@@@@@@@..@@@@@@@..@@@.@.@@
+
@@@.@@@@@@@...@@@.@@.@@@@@.@.@@@...@...@@@@.@@.@@@..@@@.@@@.@@@@.@@@@@@.@@...@@@@@@@@@.@.@@.@.@@@@@.@..@@..@@..@.@@...@@@.@@@@@.@@@@@@..
+
@@@...@@@@@@@..@.@.@@@@@@@.@@@@@@@@@..@@@@...@@@@.@..@...@..@@@..@@@.@.@@.@@..@..@@..@@.@..@@.@..@@.@...@@@@@@...@@@@...@......@@@@@@@.@
+
..@.@@.@@@@.@.@@@@..@@@.@@..@.@@@.@.@..@.@@.@.@.@.@@.@..@.@.@@@@@@.@@@.@@@.@@@@@@..@..@..@@.@@@..@.@.......@.@..@..@@@..@..@@@@@@@@@.@@.
+
@...@.@.@@@@@@@.@@@@.@@.@@@@@.@...@@@@@.@@.@@@.....@@@@.@@@@.@@@..@@.....@@.@@@@@@@@...@@@@@@...@@.@@@@@@@@@@@@@.@@.@@@.@@@@@@@.@@@..@@@
+
@...@@.@@.@@.@@@@.@@@.@@@@@.@@.@.@.@@.@@.@@.@@..@@@@@@@.@.@@@.@@@.@@.@@.......@.@@@@.@@@..@@..@@@@@@..@@@@@.@@@@....@..@@@@.@@@....@@..@
+
.@@@@@@.@@@@@.@..@@.@@.@@.@.@@@.@.@..@@@@@@.@@@@@@@.@@.@.@@@.@@.@.@.@@..@..@@@@@@@.@@@@@.@@@@@..@@@@.@..@@.@.@@.@...@..@.@.@@@.@.@.@@@@.
+
..@@@@@@@.@.@.@@@@.@@..@@@@@.@@.@.@@..@@...@.@.@@.@@..@.@..@@@.@..@....@@@@.@.@.@.@.@@@@@..@.@@@.@@@@...@@@@@@@@@@@@.@@@@.@@@@.@.@@@...@
+
..@..@...@@@.@.@@@.@@@@@@@@@@@.@@...@@@@@.@@@@@...@.@@@@..@@@@.@@@@@.@@@@.@....@@@@@.@.@@@@@.@@@@.@..@.@@.@@@..@@.@@.@.@@@@@.@@@@@..@...
+
..@@@...@..@@@@..@.@@.....@@@@@@@.@@..@@@..@@@@@..@@@@@@@@@.@@.@@...@.@@@.@@.@.@@@..@@.@@@..@@.@....@@@.@.@@@.@.@@...@..@@.@@..@.@@@.@@@
+
@@@..@@@@.@@@.@.@.@@.@@@@@..@@.@@@@@..@..@@@.@@@..@.@@.@@@..@@@..@@.@@.@...@.@@@@@.@@@@@@@.@@..@..@@@@..@.@@..@.@@.@.@@@@@@@@..@..@@@@@@
+
@@.@@@@@.@@@@@.@@@@@@@.@@..@@.@@@@@@@@@@.@.@..@@@.@@...@.@@@@..@@@@.@.@...@.@@@.@.@@.@@@@@@@.@.@@.@@@@@@@@.@@@...@@@.@@@@@@.@....@@..@@@
+
@@@...@@@.@.@...@@@@@@@@@@@@@.@@.@@@@@.@@@@@@@@@@@.@@@..@@@@.@..@.@.@.@@@@@@.@..@@..@.@..@.@.@@...@.@@@.@@@@@@.@@..@@@.@.@..@@.@.@@@..@@
+
.@.@@.@.@.@@.@@@@.@@@..@@..@..@@.@.@.@.@@..@.@@@@@.@@@@@@@@@@.@.@@.@@@@@@@.@@@.@@@@..@@@@@@@.@@@@@.@@@@.@@@.@@@@@.@@@..@@@@@@@@@@..@@@@.
+
.@..@.@@..@@@..@@@...@@@@@@@@.@.@@@.@.@@.@@@@.@.@@@.@@@@.@@.@@@@...@@@@...@@.@@.@@.@@@@@@@@@@@@@.@.@@.@@@@@@@..@@@@@@..@...@.@.@@@@@@@@@
+
..@@..@@..@@.@@@@@@@@@@.@@@@@@@@@.@.@@..@.@@@@@@@@@@...@@@@..@@@@@@.@@@@@.@.@@.@@.@..@@@@@@@@@.@@@@..@@@...@@@@@..@@@@.@@@@@@.@@@.@.@.@.
+
..@.@.@...@@@@@@.@.@....@..@@@.@@@@@@@.@.@.@@@@.@.@@@.@@@@@.@.@@@@.@..@@@@.@@@@@.@.@@@@.@@@@@@..@@.@.@@@@@@@@@@@.@.@.@@.@...@@@@@...@@@@
+
@.@@@@@..@.@@@.@@@..@.@@@@@@..@.@..@.@@..@.@.@@@@@@.@.@@@@.@.@.@@@@@@@.@.@@@@.@.@@.@@@@..@@@.@@@...@.@@@@@.@@@....@@@......@....@@@@@@@@
+
@.@...@@@.@@@@@@.@@@@..@..@@@@@@.@@@@.@@.@.@.@@.@@@@.@.@.@@.@@.@.@..@....@@@@....@.@.@@@@.@.@.@@@..@@.@...@.@.@@@.@@@.@@@@@.@@@.@@@@...@
+
.@@.@@.@@@..@@@@@..@@.@@@@@@@.@@@@@@@@@@@@.@.@@@@@.@@.@@..@@@.@@@@@@@.@@@.@.@..@@@@@..@.@.@@..@..@@@.@@@@@@..@...@.@@@.@@@@@@@@.@...@...
+
.@@.@..@@@@@@@@@@@.@@@@..@.@@.@@@@@@@@...@.@@@.@@.@@...@@@@@@@@@@.@@.@..@@@.@..@@.@....@..@@@@@@@..@.@@@@.@@.@@@.@@@..@@@@@@.@@@@@@@.@.@
+
@@@@.@.@.@@@@.@@@@@@...@@@.@.@.@@....@@....@..@@@@.@.@@.@..@.@@@@.@@@@@....@@@.@@.@.@@@.@@@@.@.@@@@@...@...@@..@@..@.@@@@@@@@...@@..@@..
+
.@@@@.@@@@.@@@.@.@@@@.@@..@.@.@@@@@@@@@@...@@...@@.@@.@@.@@@@.@@.@@.@@.@@@.@@..@..@.@.@..@..@.@@.@.@@@@@@@@..@@.@@@@@@@.@.@.@.@..@.@@..@
+
.@@..@@..@@@@@@@@.@@@@@@.@.@@..@.@.@.@...@@@@@@@@@..@@@.@@@@@@@@@@@.@@@@.@@@.@@@@.@@@..@..@.@@.@..@@@@@@.@@.@@@@@.@@.@@@@@.@.@.@.@@@.@.@
+
@.@@@@.@@.....@@.@@@@@@@.@@@@.....@.@@@@.@@@@@@.@@@@..@.@@@..@@.@@@@@@@@@@@@@@....@@@.@@@@.@@@@@@@@..@..@@@@.@.@@...@.@@@@.@@@.@@.@@@@..
+
@@..@@@@@@@@@@.@.@..@@.@.@@@@...@@@..@@..@..@.@.@@@@@@.....@@.@@.@@.@...@@.@@@@...@@@..@@@@@@@@@@@@..@@.@@.@@.@.@..@@@.@@@..@@@.@....@.@
+
.@@@@@@@@@@@@.@@@.@.@@@@.@@@@.@.@.@.@@@@@.@..@..@@..@@@@@@.@.@..@..@@@@@@@.@@@@@@..@@.@@@...@@@@@.@....@@@@@.@@@@.@.@..@.@.@@.@.@@@@.@.@
+
@..@@@@.@@@@@@..@.@@..@@@.@@@@@@.@.@@@.@@@@@.@.@.@.@@.@@@@.@@.@@@.@@@@@@@..@@.@@..@@...@.@@@@@.@@.@@@.@@...@@@@.@@.@@@.@..@@.@.@@@@@..@@
+
@@@@.@@...@@..@.@@@@@@@.@.@@@@@@...@.@@.@@@@@@@.@@@...@@@@.@@....@@.@@@@@@.@@.@.@@.@.@@@..@@@@@....@@@@@...@@@@@@@@@@.@...@.@@@@...@.@@@
+
@@.@@@@...@.@@@@.@@.@..@@@@@.@@@.@...@@..@..@@@@@.@@@@@@@.@.@@.@@@@@@.@@@@@@@@@@..@.@@@@...@.@@.@@@@@@@@.@.@@@@@@.@..@.@@@@@.@@.@@.@.@..
+
@.@@@@@@@@@.@@@..@.@..@@.@@@...@@.@@@.@.@..@@@@.....@.@@.@.@@@@..@..@@..@..@@..@@...@@..@@@@@@@.@@.@...@@@@...@@@@.@@@@@.@..@@.@@@@@@...
+
@@@.@..@.@..@..@.@.@..@@.@..@@@@@.@..@@@@.@@@.@@@.@...@.@@.@.@@@@....@@.@.@@.@@...@@@..@@....@@@@@...@@...@.@.@@.@.@..@@@@..@@..@@..@@.@
+
@@.@@.@@@@@.@@@@@@@@@@@@.@.@@@@..@@@@@@@@@...@@@@@.@.@.@@@@.@..@@@.@....@@.@@@..@@@@..@@@.@.@@@@.@...@@.@@@..@.@..@@@@.@@..@@.@.@@..@@@.
+
@@@.@@@.@@@@@.@@@@..@.@.@@@..@..@@@@@@@@@@@@@@@@@@.@@.@.....@@@@@@@.@@@.@@@.@@@@@@@@.@@@..@@@.@.@@.@@.@.@@..@@@@...@@@@@.@@@.@@@@@@@@.@@
+
@@@@@.@..@@@.@.@.@.@@@...@@@.@@@@@@@.@@@@@@@@.@.@.@@@.@@.@@@.@.@@.@@@@@.@@@@@..@..@.@@@..@.@.@@.@@.@.@..@@@.@@@@@@.@.@...@@@@@@.@@.@@.@@
+
@@@@.@@.@@@@@@@..@...@@@.@@@.@@.@@@@@@@@@@.@@@.@@@@..@@...@@.@.@@.@@@@@.@@@.@@@@.@@.@..@@@@@@.@@.@@@@@@@@@@..@@.@@@@@@.@..@@.@@@@@@@.@.@
+
.@@@@@@@@@@.@@.@@@..@..@.@@@@@@@@....@@....@@.@@@@.@@@@.@.@@@@@@@.....@@@@@@.@...@..@@@.@.....@@.@@@.@@.@@.@...@@@@@@@.@@@@.@@@@...@.@@.
+
..@..@@.@@@.@..@@..@@@.@..@.@@....@@@@.@@.@.@@....@.@.@.........@@...@@@..@@@@...@@..@.@@@@@...@@.@@@...@.@..@.@@@@@@@.@@@@...@@..@.@@..
+
.@@@@@..@.@@@@@@.@@@.@@@@@.@@@@.@@@@@@@...@@.@.@@..@@@@@@.@@@@@.@@@..@@@@@@.@@.@.@@@@@...@@@@@@@@@@@@.@.@@.@.@@@.@@.@@.@.@@@.@@@@.@.@@.@
+
@@@@@@@@@.@.@@@@@.@..@@@...@@.@@@@..@.@.@@@.@@@@..@@.@@@@@.@@@@@..@@..@@@.@@@@@@@.@..@..@@.@@.@..@@@...@.@@.@@..@@@.@@@@.@.@...@@.@@..@.
+
@@...@@@@@..@@@.@@.@@@@.@@..@@..@@@@.@@@..@..@@@@@@.@@@.@@@@@@@@@...@.@.@@..@@@@.@@@..@...@...@@.@@@.@.@.@@.@.@@@@.@@@@..@@@@@@..@@@@@@@
+
..@.@...@@@@@@.@@.@@.@@@.@@..@@@.@@@...@.@@...@@@@.@@.@@@@@..@.@.@@@@..@@@@@@.@@..@.@...@.@.@@@.@@.@@.@@....@@.@@.@@@.@@@@.@@@@.@@@@@..@
+
@.....@@@@@..@@.@@@@@@@.@@@@@@..@@.@.@@.@@@@@@...@@..@..@@@.@.@@@.@@@@@@@..@@@..@.@@@@..@@@@@.@.@@...@@...@.@.@@.@@@.@@@.....@...@@@@@@@
+
@@..@@@@.@.@@@@@..@@@@@@@.@...@@@@@@.@@@...@@@@..@.@@@@.@..@@@.@@.@@@@.@.@@..@@..@..@@.@@@@@@@..@.@@...@....@@@.@@.@@@.@.@@@...@@@....@@
+
@.@@.@@.@..@@.@@.@@@.@@@@.@@@.@@.@@....@@@@.@@@@.@@.@.@.@@@.@.@@@@@@@@.@.@@.@@@.@.@@@@@@@.@@.@.@.@.@.@@@@.@@@@@.@@@.@..@.@@....@@..@@.@@
+
.@@@@.@@@.@@@@.@@...@@.@@@@.@@@.@@@@@.@..@.@.@@.@....@@@@@@.@@.@@@..@@.@.@@.@@.@.@@@@..@@@.@..@@@@@@.@@@@@@@@.@...@.@.@@.@@.@@....@@@@.@
+
@..@@@.@.@@@@@.@@...@@@@.@@@.@@.@@@@@.@@@@.@.@.@.@@.@.@.@@@@.@@.@@@@@@...@@@@.@@....@@@@...@@@...@...@@.@@...@.@@.@@@@..@@@@@@.@.@@..@.@
+
@.@.@..@..@....@@@@@@.@@@.@.@@@.@@@@@@@@@@@@@.@@@@@.@@...@.@@...@@@@@..@.@@.@@.@@@..@@@@.@@@.@@...@@@.@@.@@@.@@@.@@@@.@@@@@@@@@@@@@.@@@@
+
@@.@@.@@@@....@@@..@@.@@@@@@@.@@.@.@@@@@@@@@@@.@..@@.@@@.@.@@@@.@@@..@.@@..@@.@@.@@@@@@..@@@.@@.@@..@@@@.....@.....@.@.@.@.@@.@@.@@@@@@@
+
@@@@..@@..@@@@.@@@@.@.@@@@.@.@@.@.@@@.@.@@@.@@.@.@@@@.@@@@@..@..@..@.@.@@@.@.@@...@@.@@@@@@@@@@@@@@@.@@@@@@.@@.@@@@@@@@..@@@@@..@@.@@@@@
+
@@@@.@....@@@@..@@@@@@..@@@@@@@@@@@@@.@.@@@@@...@@...@@...@.@....@.@@.@.@@@@.@@.@@@@@..@.@@@@@@@..@@.@.@...@@@@.@@..@@@@@.@@@@@.@.@@.@.@
+
@..@@@@@@..@@@@@..@@.@@@..@.@@@....@@@@@@.@..@@..@.@@@@@.@.@@@...@.@@@..@..@@..@@@@.@@@@@....@.@@.@..@...@@@@@@@@@@@@.@@@.@......@@@..@.
+
@@..@@@@@@@.@.@@..@@..@@...@@..@@@..@.@@@@@.@.....@@@@@@@@@@...@@.@@@@..@@.@@@@@@@@.@.@.@@@.@@@@@@@.@@@@@.@.@@@@@@.@@.@@@@.....@...@@...
+
@.@.....@@@@@.@@@..@.@..@.@@@@@@@@@@@@.@.@.@.@..@@@.@.@.@@@@@..@@@.@...@@@....@@.@@@@@@@@@@@@.@@.@@@@..@@.@...@@@@@.@@.@...@@@..@@@@@@.@
+
..@@.@@@.@..@.@..@@@@.@@.@@@@@@..@.@@@@...@@.@@@.@..@@@.@.@@@@@@@@.@@.@@@@...@.@..@@@@@.@@@@@@@@@...@..@@@.@@...@@@@@@.@@@@@@..@.@.@.@..
+
@.@@@@@.@.@@@@@.@..@..@@@@...@@.@...@.@@@...@.@@@@@@@@@@@@@@.@@@@.@@.@..@....@@@.@@@@.@@@.@@..@...@.@@@@@.@@@@....@@@@..@@@.@..@.@.@.@@@
+
..@@@@.@..@@@@@.@@.@@@.@@@@@@.@@..@@@..@.@@@@@.@.@@@@.@..@@.@.@@@@.@@@@.@.@@@.@..@.....@.@@@.@@..@@.@..@@.@@@@@@..@.@..@@.@..@@@@@@.@..@
+
@@..@@..@.@.@@@@.@@@@.@@@@@@@@@...@@@..@@@.@@@@.@.@@@@@...@@.@..@.@@@@@@@.@@@@@@@@..@.@.@@@@@.@..@@.@@@@@@@..@@@@@.@@@.@@.@@.@.@....@@..
+
@.@@@..@@@@@.@@@@@@@.@@....@@@..@.@@.@.@@...@.@...@@.@@@@@@@@@@@@@.@@.@@@.@.@@...@@.@@@.@.@@@.@.@.@.@....@@@@.@@@@.@@@@@@@.@.@.@@@@@.@@@
+
@..@@..@.@.@@@@@@@..@.@@.@@@@@.@.@.....@@@..@.@@..@@@..@@.@..@.@@@.@.@@@@..@......@.@@..@@@.@@..@@.@@@@..@@@@@.@@@.@@..@@@@@@@@.@@@@@@@@
+
.@@..@...@@@@@@@.@@@@@@@..@...@@@..@@@.@@@@..@@@@@@@..@@.@.@@.@@@.@@@@......@......@.@@@@.@@@@@@...@.@@@...@.@.@@@@@@.@.@@@@@..@@@@.@@@@
+
..@@.@..@@@.@.@.@@.@.@@@@@...@@@..@.@@.@@.@@@@@@@@@.@@@.@..@...@.@.@@@@@.....@@@@@@@@..@@@@.@@@.@@@@@....@.@@.@.@@@@@@@@..@@@@...@@...@.
+
@@.@.@.@@.@@.@@..@@@@@@.....@..@@@.@@.@@@@@@.@@@@.@@@@@@@@.@@@..@.@@@.@..@...@..@@@@@.@@@@.@..@@.@@....@..@.@@@@@@.@..@@@@@@..@.@@@...@.
+
@@.@@@@@@..@@.....@@.@@@@@@@@@..@@.@@.@@@@@@...@@@@@.@.@@@@..@@@@.@@@.@.@.@@@@.@.@@@@@@.@@@@@@@@.@@@@@@@@@...@@.@@@..@.@@@.@.@..@@..@...
+
@@@.@...@.@@@@@@@.@@.@@@@@@@@@.@@.@@@@@@@.@.....@@@..@.@@.@.@@....@@@.@@@@..@@@...@...@@@@@@....@@@@.@@..@.@@@@@.@..@.@@@@@@@.@....@..@.
+
..@@@@@..@@.@.@..@@@.@@.@@@@@@.@@@.@.@@@@@@@@@@.@@.@@@@@..@@@@.@@.@.@@@@.@@.@@@@@@@.@@.@@.@@.@@@.@@@@.@@@.@@@@@..@.@.@..@@..@@@@@...@.@@
+
@@@@@@.@@@.@..@.@@@@@.@@...@..@.@@@@@..@@@..@@@.@.@@@..@@.@@@.@@..@@.@@.@@@@@.@@@@.@@.@.@@@........@@..@@.@@@.@@@..@@@@@@@.@@@@@@.@.@@.@
+
...@@@@@@@.@.@@...@@@.@..@@.@..@@@@@@@@@@@.@.@.@@@@@@@@@@@.@@..@@.@@@@@@@@....@@.@..@.@@..@.@.@@@.@.@.@.@@.@@@...@...@@@@@@@@@@@@.@@.@@@
+
@.@@@@..@@@@@@.@.@@..@@@@.@@@@@@@.@..@.@.@@.@@@.@@.@.....@@.@@@@@@@@.@@@@@@@@.@@.@@.@@@..@..@@@@.@@@..@@@@..@@..@@...@.@@@@@@@@.@...@.@@
+
.@@@@@@@@...@.@@.@@@@@@@@.@@.@.@@.@.@@@@@@@@..@@@.@@@@@.@@@@.@.@..@...@.@@.@@@@@@@@@.@.@@@@.@.@@..@@@@.@.@@@.@.@@..@@..@@@@@.@@@@..@...@
+
.@@@.@...@..@..@@.@@..@..@@@@.@.@@@@@@@@@@.@.@@.@..@.@@@@@@@@@..@@@@@..@@@@...@.@.@@@@.@.@.....@@..@@@@@@@.@@@@@.@.@@@.@@@@@@@@@@.@@@@@@
+
@@.@..@@@@.@.@@@@@@.@.@..@@@.@@@@@.@@.@@.@@@@@...@..@.@@.@@..@...@@@.@@.@.@@@.@.@@@@@@@@@@@@@..@....@@..@.@@..@@.@.@.@.@@..@.@@@@@@@@@@@
+
.@@.@@@@@.@.@@@.@@..@@@.@@@@@@.@@.@@@@@@@@.@@@@.@@...@.@.@@@@@....@@.....@.@.@.@@@@@.@@@@.@@@@@@@.@...@.@@.@.@.@.@@.@.@@@.@@...@@....@@@
+
@..@@@..@@@@..@@@@@@.@@@..@@@@@@@@@@@..@@@@@@.@@@@..@@..@@@@@..@@@.@.@@@@..@.@@..@@.@@@@@@@@..@@@@@@@@@@@.@@..@.@@.@@@@.@.@@@.@....@@@.@
+
.@@.@@...@.@@....@@.@.@@@@@.@@@@...@..@@@@@@@@@.@@@@@.@@.@@..@.@@...@.@@@@@.@@@@@...@....@@@@..@@@@@@@@@.@.@.@@@@@@..@...@..@@@@.@..@@@@
+
@@@@@@@@..@@@@.@.@@..@@@@..@.@@...@@.@@@...@@@.@@.@...@..@@@@@.@@@..@.@@@@@@@@..@..@..@..@@.@@@.@@.@@....@@@@@@.@@@.@@@@@.@....@@@@@@@@@
+
@.@@.@@@@@.@@@....@@@..@@..@.@@..@@@@@.@....@@@@@.@.@@.@@..@..@@..@@@@.@@@.@@@@@@@@@@.@@@@@.@.@.@@@.@.@@@.@@@@@..@@@@..@@...@..@@@@@@@@@
+
@@@@@.@.@@@@@@...@@....@@@.@@...@@.@@@@@@@.@.@@.@@..@@@..@.@..@@@@.@@.@.@..@@@..@.@.@.@.@@@@.@@@...@@.@@@@@@@@@@..@@..@.@@@@@@@.@...@.@.
+
.@.@..@@@@@@..@@@..@@..@@@@@..@@@.@@@@@.@..@.@.@@@.@...@@@@@..@...@@.@.@.@.@@@@@@@@@.@.@@@@.@...@@.@@@.@.@@@..@.@@@@.@.@@@.@...@...@..@@
+
.@@..@@@@@.@@@@@@@@@..@@@@@@.@@..@@@@@@@@@@@..@.@....@@.@@@.....@@.@@@@@@@@.@@@.@@@.@@@@@@@@@@@@@@@@...@@@@.@..@@...@.@@@@...@@.@.....@.
+
..@.@@@.@@@@@..@@@@@@@@...@@@.@.@@@.@@@@@.@@@.@.@@.@@@....@@...@@@.@@@@..@.@@@@.@@@@@@@@@@@..@@@.@@@@.@.@..@@@.@@@@.@.@..@@@@..@@@.@...@
+
@@.@.@@@@.@.@@.@@@@.@.@@.@.@@@@@..@@@@...@.@@@@@@@...@.@@.@@@@.@@@.@..@@.@..@@@@@.@.@@.@@@..@.@@@@..@.@@@@@@..@@@.@.@@.@@@.@@.@@@@.@.@@@
+
.@@.@.@@@@.@@..@@.@@.....@@@@@@@@@@..@@..@@@@...@@.@@..@.@@.@@@@@@..@@.@@@.@@@@@@...@@.@@@@@@..@@@@@.@@@@@..@@@@@.@..@@.@@@@@@@..@@@.@@@
+
@@@@@.@@.@@@.@.@@...@....@...@@@@..@@@@.@@@@...@@..@@@@@...@@@@@...@.....@@..@@@..@@@@@@.@.@@@@.@@@@.@.@@.@@.@@@.@.@@.@...@@..@@@@.@@.@@
+
..@@.@.@@@@@@.@@@@@.@@..@@.@@@...@.@@.@.@.@@.@@.@.@.@@@.@.@@@@@@@@@@.@.@.@.@@@@@....@@.@@@@@@@@@@@.@@@.@@@@@@.@@....@.@..@@...@..@@...@@
+
@@@.@@.@@...@@..@@..@@@.@@.@.@.@@...@.@.@..@..@..@@.@@@..@@@@@.@.@.@@..@@@@....@@.@@@@.@@.@@..@@..@@@..@@...@@@@....@@@.@@@@@...@@.@@.@@
+
.@.@.@@@.@@@@@@@@@.@@@@@@@@@@@...@@@@@@@@..@@@.@.@@.@@@@...@@@.@@.@.@@.@@@@@@@@@.@.@@..@@..@@@@@@..@@.@@@@@@.@@@@.@@@@@@@@@.@@@.@..@.@@@
+
@@...@@.@.@@...@.@.@@@@@@.@..@@@@..@...@@..@@@@..@@@@...@@@@..@.@@.@@.....@@@@@@.@@@@@@@@@@..@.@.@@@@@@@@...@.@.@@@@@@@.@@.@@@..@.@@@.@.
+
@@..@@@@.@@@@@.@.@.@@@@@@@@@..@@@@@@@@@@.@@@@@.@@@.@@@.@@.@@@@@@@.@@@..@@@.@.@@@.@.@.@@@@@@@..@@.@@@.@@.@@@.@@@@.@@@@.@@@@@@@@.@@@@.@.@@
+
@..@.@..@@@@@..@@..@.@@@.@@@.@.....@..@@..@.@..@@@@.@...@...@@@@..@@.@.@..@@@...@....@@.@@@..@..@@.@.@@@@@.@.@@@@@@@@@...@@@.@@.@.@..@@@
+
@@.@@@.@@@@@..@.@@@.@@@...@.@@@@.@@@@@.@@.@@.@@..@@@..@.@@@@.@@@@@@@@@@@.@@@.....@@@@@@......@@.@...@@@.@@@@.@.@@@@@@@@@.@...@..@@.@@.@@
+
.@..@.@@@.@@@@@@.@@@@.@@.@.@.@@@.@@@@@..@.@@@.@@@@@@@@@@.@.@@@@..@.....@.@@@.@...@@@@@@@@.@..@@.@..@.@@@...@@@@@..@@@.@.@@@.@@@.@...@@@.
+
.@.@..@@..@@....@.@@.@..@@.@.@....@@@...@.@@..@.@@.@@@...@@@.@.@@@.@@.@.@@@.@@@@...@@.@@@@@@..@@.@@.@@@@.@@@@@@@.@@@@@@.@@@@..@@@..@@@@@
+
@@@.@@.@@@@@@@@@@..@@@.@@@@@@..@@@.@@@@@.@@@@@@.@.@.@.@@@@.@@..@@..@@@.@.@@.@..@...@@@..@@.@@@@.@.@.@@@@.@@.@@@.@...@@.....@@.@.@@@@..@@
+
.@@...@@.@.@@@@.@@@@@@@@@@@...@@@@@.@@@.@@@@@@@@.@.@@@@@@@@@@@@@.@@...@@..@@@@@@.@@.@@@@@.@.@.@@@@@@@@...@..@@@@@@.@@@@@@..@.@..@@@.@.@@
+
.@@..@.@@.@.@.@.@@.@@@.@@@@.@@@.@.@@@@@..@...@@@.@@@@@..@@@@..@.@@@@.@.@@@@.@@@@@@@@@..@.@@.@@.@.@@@@@@@@@@@@@@@@..@@..@@@.@..@@@@.@@@@.
+
.@@@@@@.@@@.@@@@@....@@@.@@@@@.@@@@.@..@@@@.@@@.@@....@@@@@@..@@@@..@.@@@@@@.@@@@@@@@@...@@...@@@..@@@@@@@@@.@.@@@@.@..@@@.@@@@@@@..@...
+
@@.@@.@@@@@@@@@@....@@@@@@.@..@..@.@.@@.@@.@...@.@@@@.@@.@.@@@.@@..@.@@@@@@..@...@@@.@@.@@@.@.......@@@@..@@@..@@.@@@@..@@@..@@@@.....@.
+
.@.@@@@..@.@@@.@@..@..@@@.@.@@@@@@@@@@@@@.@@@@@@@@@...@.@@@@..@@@@@@......@@@@@.@@@@@.@@@..@.@.....@@.@@.@@@@@@.@.@@@.@@@.@@@.@.@.@...@@
+
.@@.@.@..@@@@@.@@@@@..@@@@@@@@@@@.....@.@@@@@..@@@.@@.@@..@..@@@@@@.....@@..@@@@@@..@@@.@.@...@@@..@@@@.@@@@@@.@.@..@@..@@..@.@@...@.@@.
+
@.@@@@@@....@...@@@.@@.@@@@..@@@@@@@@@.@@@..@@.@@@@@@@..@.@@@...@.@@@.@@@...@@@@@@@@@..@@@@@@@.@@@.@.@@..@.@@..@@@....@@@@....@@@@@.....
+
@@@@..@@.@.@@@@..@@@@@...@@@@.@@..@.@@@@@@..@@.@.@.@@@@@@.@.@..@@.@@.@@@@.@@..@......@@@@@.@@@@.@@@.@.@.@@@@@@@@@@@@@@@@.@@@@@@@@@.@@@@@
+
...@..@@@@@@@..@@.@@@@..@.@@.@@@@@@.@@@@@....@@..@@.@@@.@.@@.@@@.@@@@.@@@.@.....@@@@@@@@@@@@@@..@.@@@@.@@@@.@@..@.@@@@.@@@@@.@.@.@@@@@@@
+
@@@@.@@@@.@.@@@@@@@@@...@..@@@.@.@@@@.@@@.@..@@.@@@@..@@@@.@@@@@@@@.@.@@.@@@@.@@@.@@@@@..@@@.@.@.@..@.@.@.@@@@.@@@@@@@@..@@@@@..@..@.@@@
+
.@.@@@.@@..@@@@@..@@.@@@.@@.@@.@@@@@.@..@@@@@.@@@@@.@.@.@@@@@.@@..@@@@.@.@..@@..@@@.@@.@..@..@@.@..@@@@.@.@.@.@@@@@@@@@.@@@@@.@@@@..@.@@
+
@@@..@.@@.@@@.@.@@@...@.@@@.@@@..@@..@@@..@.@@@...@..@@@.@@.@...@@@.@@.@@@.@@.@@@.@@@@.@@@@@@@@.@...@.@.@.@@@.@@@.@@@@@@@..@@@.@@@@@.@@.
+
@@..@@@@@.@@@@@.@@@@@.@@@@..@@@@@.@@@.@@.@@@@@...@..@.@@@@@@@.@@.@@.@.@@@@..@@@@.@@.@@@.@.@...@@@..@.@.@@@.@@@.@@.@..@@@@@..@@@@.@.@@@@.
+
@@@..@.@@@@..@@.@@@.@.@@..@@@@@.@@@.@@@.@..@@@@@@@@.@@@@@@@.@@.@@@@.@@@.@@@@..@@@..@@@..@@@@...@@.@.@@@@@.@@.@@.@@@@@....@.@@.@@@.@@@.@@
+
@@.@@@..@@@@@@.....@@@@.@....@@@@.@@.@@@@@@.@@@.@@.@@@.@@@.@@@@@@@@.@..@@@@@.@.@@@@@..@@@@@@@@@....@@.@@@@.@@@@@@@...@.@..@@@@@@.@@@@@..
+
@@.@.@@.@@@@@@@.@@@@@@@@@@.@..@....@@@@..@.@@@@...@@.@.@@.@@.@@@@..@@@@.@..@@..@@@@@..@@@@.@.@.@..@@.@@@@.@...@@@@@@..@@.@.@@@..@@@@.@@@
+
@@@@@.@@.@@@.@@.@.@@.@@@.@@.@@@.@@...@@.@@@@@..@@.@@@@.@..@@@.@@.@@@@@@@@@.@.@@@@.@@.@@@@.@@@@@@..@@.@.@..@@@@@@@.@@@..@.@@@@@..@....@..
+
.@@@@@@..@@.@.@@.@@@@..@.@.@@@@@@@.@@.@..@@@@@@@.@@@@@....@.@..@.@@@@@.@@@.@.@..@@@..@@@..@@@@@@@@.@@@.@.@@@@..@.@...@@@@@@@.@@@.@@...@@
+
@@@@..@.@..@@@@@@.@@..@@..@.@@@.@@@@@@@@@@.@@@@@@@@@@.@.@@@@@.@@@...@@.@@@@.@@.@@.@.@.@.@.@@@...@@@@@@.@.@@.@.@.@@.@@@.@@@@.@.@@....@.@.
+
@.@@@@@.@@@@.@@..@@@.@@@.@@@@@@..@.@@.@@@@@@@@.@@@@@@..@@@@@@...@@..@.@@@.@@..@@@@@.@@@.@.@.@.@.@@@.@.@.@..@@..@@@..@@...@.@@@@@@@.@@@@@
+
@.@@.@..@@@@@.@.@@.@@.@@.@....@@@@..@@..@.@@.@..@@...@@@@@@.@@.@@@..@@@@@..@@..@@@.@@@....@@@@@@..@.@@@@.@@@....@@...@@@@...@@@@@@@..@.@
+
@@@...@@@@@.@....@@@@@@@..@@@@..@@@@@.@@.@..@@@@@@@.@.@.@@.@.@@.@.@..@@@@@@@@@@@.@..@..@@@@@@@@@@@..@..@@.@@.@@@@.@@@@@@..@@@@.@@@..@@@@
+
@@@.@@@@@@@@@@.@@.@@..@...@.@..@.@...@@.@..@@@@@..@.@@.@@@@@@@@...@@@@.@.@.@@@..@@.@...@@.@@@@.@@@@@@@@@..@..@.@.@.@.@@.@..@@...@.@.@...
+
.@@@@@@@..@.@..@@@.@@@@@..@@.@@.@@@.@@@@@@@.@@@@@@@@..@@@@.@@.@@.@.@@..@@@@.@@@@.@@@@@..@@@@@@@...@@@@.@@.@@@@.@@@..@@@@@@..@@@@..@..@@@
+
.@..@@@@@@.@....@@.@@@@@..@@@@..@@.@.@@@@...@@@@@@.@@@.@.@..@@@@.@@@@@...@@@@@@.@..@.@@.@.@@.@...@..@@@@@.@@@@@@.@@..@..@@@@@@@@@..@.@.@
+
@@@@@@@@@@@@.....@..@@@@@.@..@@.@.@.@.@@@.@.@@..@..@@.@@@@..@.@@@@@..@@@@@@..@.@@.@@.@@@@@@@@.@....@.@@@@@.@...@.@@@.@.@.@.@@@@@..@@@@@@
+10
day_4/mini.txt
···
···
+
..@@.@@@@.
+
@@@.@.@.@@
+
@@@@@.@.@@
+
@.@@@@..@.
+
@@.@@@@.@@
+
.@@@@@@@.@
+
.@.@.@.@@@
+
@.@@@.@@@@
+
.@@@@@@@@.
+
@.@.@@@.@.
+178
day_5/5.c
···
···
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include <string.h>
+
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
+
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
+
typedef struct {
+
long long min;
+
long long max;
+
} tuple;
+
+
+
tuple* remove_element(tuple* arr,int i,int* len) {
+
for (int j = i; j<*len; j++) {
+
arr[j] = arr[j+1];
+
+
}
+
arr = realloc(arr, (*len-1)*sizeof(tuple));
+
(*len)--;
+
return arr;
+
+
}
+
+
+
+
int main(int argc, char* argv[]) {
+
+
tuple* limits_arr = NULL;
+
int limits_arr_len = 0;
+
+
FILE* f = NULL;
+
ssize_t nread = 0;
+
size_t size = 0;
+
char* line = NULL;
+
long long start;
+
long long end;
+
long long ingridient;
+
int fresh_ingridients = 0;
+
int fresh = 0;
+
unsigned long long total_fresh_num = 0;
+
+
f = fopen(argv[1], "r");
+
+
while ((nread = getline(&line, &size, f)) > 1) {
+
printf("%s",line);
+
+
// add to the list of min and max values in typle format
+
//
+
start = atoll(strsep(&line, "-"));
+
end = atoll(strsep(&line, "-"));
+
int add_new_entry = 1;
+
+
//check overlaps ~ish~ if new range is bridging two other ranges it still results in overlaps.
+
//however reduces the original amount of ranges.
+
if (limits_arr_len>0) {
+
for (int i = 0; i<limits_arr_len; i++) {
+
if (start<=limits_arr[i].max && start >= limits_arr[i].min) {
+
//[a,start,b],end
+
// if
+
if (end >= limits_arr[i].max) {
+
limits_arr[i].max = end;
+
add_new_entry = 0;
+
break;
+
} else {
+
add_new_entry = 0;
+
break;
+
}
+
+
} else if (start < limits_arr[i].min) {
+
if (end > limits_arr[i].max) {
+
limits_arr[i].max = end;
+
limits_arr[i].min = start;
+
add_new_entry = 0;
+
break;
+
} else if (end<=limits_arr[i].max && end >= limits_arr[i].min) {
+
limits_arr[i].min = start;
+
add_new_entry = 0;
+
break;
+
}
+
}
+
}
+
}
+
if (add_new_entry) {
+
limits_arr_len++;
+
limits_arr = realloc(limits_arr, limits_arr_len*sizeof(tuple));
+
+
limits_arr[limits_arr_len-1].min = start;
+
limits_arr[limits_arr_len-1].max = end;
+
}
+
}
+
+
+
// behold, as i am about to write the worst overlap search algorithm known to humankind.
+
int large_repeat = 0;
+
+
do {
+
+
large_repeat = 0;
+
// as long as we do mergets, we run the whole thing again.
+
+
for (int i = 0; i<limits_arr_len; i++) { // limit_arr_len will be changing as this goes i have no idea if this is optimal
+
start = limits_arr[i].min;
+
end = limits_arr[i].max;
+
int repeat = 0; // if a merge happened, we will set repeat to true, and so will run the cycle again to check for new overlaps
+
do {
+
repeat = 0;
+
for (int j = i+1; j<limits_arr_len; j++) {
+
//this is horrible
+
// we go over every entry in limit_arr.
+
// if another entry has one of the ends inside, we set the other end equal to the appropriate value, whichever gives the largest range.
+
// then delete it.
+
if (limits_arr[j].min >= start && limits_arr[j].min <= end) {
+
limits_arr[i].max = MAX(end, limits_arr[j].max);
+
limits_arr = remove_element(limits_arr, j, &limits_arr_len);
+
repeat = 1;
+
large_repeat = 1;
+
j--;
+
}
+
else if (limits_arr[j].max >= start && limits_arr[j].max <= end) {
+
limits_arr[i].min = MIN(start, limits_arr[j].min);
+
limits_arr = remove_element(limits_arr, j, &limits_arr_len);
+
repeat = 1;
+
large_repeat = 1;
+
j--;
+
}
+
else if (limits_arr[j].min <= start && limits_arr[j].max >= end) {
+
limits_arr[i] = limits_arr[j];
+
limits_arr = remove_element(limits_arr, j, &limits_arr_len);
+
repeat = 1;
+
large_repeat = 1;
+
j--;
+
}
+
}
+
}while (repeat);
+
}
+
+
+
}while(large_repeat);
+
+
+
+
+
+
+
for (int i = 0; i<limits_arr_len; i++) {
+
total_fresh_num += limits_arr[i].max - limits_arr[i].min +1;
+
printf("min %lld, max %lld, num: %lld\n",limits_arr[i].min,limits_arr[i].max,(limits_arr[i].max - limits_arr[i].min +1));
+
}
+
+
//not we go through ingridients
+
+
while ((nread = getline(&line, &size, f)) != -1) {
+
printf("%s",line);
+
fresh = 0;
+
ingridient = atoll(line);
+
for (int i = 0; i<limits_arr_len; i++) {
+
if (ingridient >= limits_arr[i].min && ingridient <= limits_arr[i].max) {
+
fresh= 1;
+
fresh_ingridients++;
+
// printf("ingridient %lld is fresh in range %lld-%lld\n", ingridient,limits_arr[i].min,limits_arr[i].max);
+
break;
+
}
+
}
+
+
}
+
+
+
+
printf("total %d fresh ingridients",fresh_ingridients);
+
printf("total fresh ingridients possible: %lld\n",total_fresh_num);
+
+
free(limits_arr);
+
+
free(f);
+
free(line);
+
+
+
return 0;
+
}
+1178
day_5/input.txt
···
···
+
213743501161200-213743501161200
+
221359789392478-222960432116258
+
553905700373062-561794342755365
+
388351876706917-388578461376678
+
263685821321516-270464997549766
+
384957836075964-385057316204755
+
86932924454422-88726115602910
+
64713316693400-65189382496202
+
68179610157787-68454649435444
+
143154545648377-145980913110898
+
390250299542523-390843409397977
+
392162789636707-394167531415509
+
467795551515047-469145316638624
+
73412860995201-78319783604609
+
174577844186025-180222947242739
+
34889394659118-37852045203256
+
506719917120116-506719917120116
+
64999889315593-65189382496202
+
62511033442122-62882231057991
+
169629548448978-169629548448978
+
195991726717561-200347594718591
+
80800364897743-82410540424990
+
157966143122749-158625789879543
+
414893276002289-420734433214551
+
468854880571347-470178150823398
+
293047529057561-293047529057561
+
526293793744803-526800435871324
+
154610263545675-155018832807006
+
85676500485010-87494001551296
+
404052468013478-411059540873663
+
529805857574316-530354749652142
+
282126028703430-287392631951184
+
536612716581558-542001885354658
+
224389325429033-225956850054114
+
389327354686290-389941649666180
+
226458176996215-227998751964573
+
466681105242973-468035461798180
+
132182495488136-136864510598769
+
158625789879543-158943957000511
+
222498723695457-223722626496659
+
24396986945805-29009989981082
+
387070084421471-387699738663307
+
463761550427134-465101663712718
+
244484473250009-249824444617715
+
235682381324440-239428507922589
+
356542431952285-357218504633271
+
528809160802420-529163494010802
+
203275761047276-207893046967514
+
65189382496202-65740304733466
+
84564501332038-86342507935742
+
528809160802420-529739126171581
+
430824287436458-430824287436458
+
270464997549767-270464997549767
+
73412860995201-73412860995201
+
203275761047276-207893046967514
+
465765531974637-467339424840641
+
88308683283200-90314897336701
+
506719917120116-509378158464998
+
154610263545675-155018832807006
+
436351058276905-441549428537929
+
390250299542523-390501802123222
+
464766089052130-465995972804612
+
153723748856595-154247928476913
+
524957458539564-525444885761624
+
193355047594087-195991726717559
+
68057027039766-68454649435444
+
114292754379846-114292754379846
+
476176387291714-479287347759176
+
68727093315072-69054421292865
+
374010991378735-378095042001312
+
396702787271742-398555495412596
+
92985559435331-99083983384255
+
524317721420090-524645436296520
+
470916081729043-472406223184007
+
307193970359996-309957481846034
+
83208072709351-85336482970086
+
61908006035935-62767933777530
+
12440214380075-19413829756369
+
158268094987535-158625789879543
+
323855611951188-327225842492665
+
232121351950005-235682381324439
+
104580961113313-109652180451852
+
155719620755384-156378640409574
+
225242642256272-226838958939168
+
126345620041269-129628037616258
+
272979306019768-272979306019768
+
229571449179868-230955409924473
+
15572428843108-19413829756369
+
486438625661094-489174884685392
+
399063478386186-400626043814074
+
61434917885505-61908006035935
+
442807002499434-447467590937981
+
153470274802250-153891356149723
+
548528649335253-552132613556960
+
302406550101741-307193970359994
+
284836416410676-290905691766532
+
134736737710827-138821293926430
+
524645436296520-525444885761624
+
347299925469182-350731461622425
+
333121507005172-333121507005172
+
257633973479609-259311991697339
+
418350619486212-420734433214551
+
523873015780814-524032209716334
+
424331863324814-430824287436457
+
143154545648377-148152467497972
+
156770859353106-157228370844559
+
523401105399726-524032209716334
+
3672218268426-9069958349825
+
41190120499524-48710502110828
+
171431709160547-176780839877720
+
65740304733466-66283299959280
+
3672218268426-9069958349825
+
157444284967581-157743465985657
+
99083983384256-99083983384256
+
114292754379847-118122243442587
+
32783805912506-34889394659117
+
495774309849622-495774309849622
+
385597213338484-386130309524989
+
66422129062863-66711994098586
+
390501802123222-390843409397977
+
227420995218497-229137292369316
+
518765954978807-520809013033287
+
81872566000969-83813851796454
+
272979306019768-280055074059068
+
394469512488834-396279958092492
+
469546011173175-471346897231698
+
442807002499434-451270889383530
+
184738598610317-187210601572675
+
364359970290004-369109081626630
+
327225842492665-327225842492665
+
353087698181504-361406479744402
+
293047529057561-299710639297794
+
486438625661094-489174884685392
+
472788183962691-480272823246663
+
152000130191943-152486238796869
+
386858817856261-387699738663307
+
462503261552047-464039809812541
+
183175626133351-189172211000972
+
163807315460788-169629548448978
+
393534536834350-394918686174827
+
344389995827602-347299925469181
+
159774306485562-160419960771595
+
544514849402253-552132613556960
+
65400483278322-66283299959280
+
63641646788533-63945948546021
+
228387323493940-230123402570745
+
223334527687062-225118219054282
+
398001413033472-399528430973758
+
389120143291068-389327354686290
+
251886663550811-259311991697339
+
69054421292865-69216943568303
+
109652180451852-109652180451852
+
53011962076696-56344039055008
+
400162615237818-402020110303086
+
43204303716398-46879070810322
+
314744608126757-318669297711175
+
432956413748504-436351058276903
+
374010991378735-379580541653265
+
53011962076696-58576758868523
+
151246265148187-151690444980057
+
67160465476009-67649438641309
+
333121507005173-341135415342898
+
456177793236387-461879349449355
+
395508284503006-397494347386228
+
533093622413503-538889692659981
+
561794342755365-561794342755365
+
515616143391792-518765954978806
+
69696292125615-70040914201079
+
68727093315072-69401400390266
+
495774309849623-500237151028475
+
369109081626631-369109081626631
+
529163494010802-529436944344583
+
404052468013478-411059540873663
+
121847024509459-126345620041267
+
522880293422404-523179474172233
+
158459878825465-159131956260867
+
213743501161201-219471291456959
+
+
494837294376908
+
435660505746994
+
99786817997391
+
472909760977579
+
463484249547475
+
273865746097567
+
546948282990871
+
313905748059736
+
389220642255587
+
264910144325219
+
194634550937143
+
452503195637112
+
38664030641468
+
8643898228674
+
408947325836900
+
56337977420387
+
174507776974605
+
140836347671248
+
47631986998014
+
235031396283281
+
343857671631037
+
252684431369877
+
561260764726582
+
13377139290760
+
335659611077426
+
305254801428350
+
23068609919756
+
358157740175632
+
336124567002906
+
499856499644500
+
245581152411526
+
4607628398578
+
113989649477446
+
261695855054656
+
54145308170978
+
23643219088083
+
288564055768829
+
76218205231423
+
383056969666651
+
206049039348792
+
362866693952230
+
447390838499260
+
269419273985840
+
495173666576593
+
475030519522818
+
12103270345560
+
107629037149479
+
393860930903512
+
141626771549297
+
250924689541736
+
5883371952028
+
423912703644535
+
302546348630570
+
436937082048731
+
494664825705194
+
448188584703582
+
254291468010192
+
221243211979987
+
350545951774103
+
393592820188728
+
32794726074237
+
215351251387887
+
18789663384866
+
546887929110328
+
229634965624793
+
26225821034784
+
175436974010271
+
330555143105279
+
540559732802993
+
146048634742198
+
457763885033022
+
255063532513955
+
523233693563579
+
520111841799148
+
554058843495886
+
318786207342405
+
377363192140595
+
99808601402762
+
18925946943601
+
114133861116596
+
466658719803329
+
239088721753669
+
437089455846288
+
368941022635265
+
396739332676075
+
136405831558024
+
56176226086142
+
89188104356081
+
522069015255255
+
321118023164859
+
9031526519848
+
426715696390470
+
525707768388028
+
152077432064905
+
409969738179310
+
413539799236118
+
394325762684221
+
152819990377936
+
394401954863928
+
126602621671422
+
504598064766126
+
458638902263336
+
326459124993522
+
419281996008737
+
490842973818114
+
146271762366396
+
22503238293943
+
537920215050605
+
559195645649780
+
53366531225879
+
147488127813515
+
87770751897444
+
355793262392237
+
29238551733499
+
480135691758946
+
538362412784828
+
450359874870348
+
173926045560484
+
401263245119900
+
469761746266259
+
517263368251455
+
49071456365129
+
137992440004065
+
414963191734774
+
478773793672052
+
323893963358308
+
346609563056966
+
528752351256778
+
296671648977112
+
374729839695085
+
454860071033636
+
467162739020170
+
507732258880396
+
230301737270720
+
289177397090688
+
528799065232012
+
165854989903172
+
406394881004817
+
481447401833724
+
516889448667819
+
554061619704684
+
392059778405048
+
175159258924467
+
463421480856860
+
544635640616828
+
309477164734560
+
231037323484799
+
340860687007580
+
448875290293314
+
127397009585739
+
246830806645075
+
518431937476941
+
3732761639887
+
147285882576699
+
396422419852454
+
27478056069416
+
286717356301433
+
236893740878667
+
290016489594859
+
298887079519963
+
461497186313441
+
235329424183967
+
556647097855604
+
261197438978660
+
118073942807968
+
285360172331044
+
169445091271339
+
418603412598323
+
416679342584654
+
163804209188500
+
167161416515668
+
300589656673348
+
84155065043548
+
298520045126168
+
154549118044364
+
509513039742643
+
406174906841001
+
239965534880610
+
264241638530762
+
326907134654161
+
148801284014366
+
252845684706962
+
538160202161003
+
396627759613700
+
546079642043457
+
75651194219911
+
432586855556463
+
96802942627830
+
25041440445919
+
107116271154358
+
303702054634544
+
398781252434901
+
503172397854082
+
379315602131933
+
236979084549993
+
451397490649019
+
279868894290565
+
524617891089775
+
136961187947989
+
136429946001689
+
76950346304543
+
306928041509744
+
312915314588031
+
298998035287402
+
34760223536011
+
446404886235072
+
197388407848521
+
333191332684099
+
221740779665886
+
309416371878888
+
158477659448444
+
516680333458799
+
44853377628995
+
278888606895658
+
278420982927684
+
175703803052425
+
470568172737830
+
236084777219214
+
397984966672806
+
473425480788950
+
522025578442624
+
427215517454322
+
198299794101146
+
349413337275427
+
125618902680777
+
89314589371888
+
368825410886351
+
330191130666564
+
387752207575580
+
440138070603836
+
227890254261097
+
44488299718077
+
29751481585745
+
25028650437464
+
547595768878
+
174236076333058
+
133712293361829
+
540096229159911
+
360206980499620
+
258011259781602
+
549364690524601
+
10091206687143
+
470374190930049
+
179075060473731
+
377242979825409
+
352690157476711
+
278488530349263
+
384422855896670
+
49811728480863
+
267349043407318
+
489564767823505
+
73008037929843
+
124299946430397
+
217882757871908
+
108999668545307
+
20703850023939
+
496246608935789
+
541069367118771
+
305122372020761
+
115492357896852
+
193492845516396
+
417751256829819
+
285658063335359
+
246744409069648
+
351755993275651
+
98127769000175
+
482372026370776
+
457710650905360
+
18026862445928
+
108534833075078
+
169824794939485
+
559142599641987
+
2085564400281
+
309173175821638
+
456153160917877
+
293414602125014
+
547198783459634
+
76444012948089
+
529290472539497
+
355365766193271
+
287986193982431
+
173227908416238
+
551806007985042
+
186471826913763
+
121801161824669
+
97800001698241
+
342494173599273
+
12505387404524
+
306058580091348
+
318867143656603
+
428585013529288
+
256312606382787
+
366239026804887
+
51539372147365
+
66134064995673
+
79041166640102
+
75784996215689
+
287522598289639
+
332881462196418
+
520053787194950
+
297834256156760
+
46395714814142
+
478528279216500
+
283333063204819
+
245859459924907
+
473660316927145
+
307732071267576
+
277227366442821
+
390581386350646
+
376021035764980
+
463341164063984
+
185816349933763
+
241632149492477
+
289330190978899
+
476909402388343
+
458026449622767
+
257790586910592
+
174516863536188
+
285936912577790
+
401130002886351
+
458803825528219
+
478494606977638
+
345725593786871
+
138388443036459
+
282300697387892
+
71713317490775
+
556366167372211
+
456995326804110
+
247592812172057
+
494021760846937
+
371537593769295
+
170534224078136
+
42472063541628
+
8253779665434
+
372548475874699
+
9789888924117
+
405774436581168
+
108848101351560
+
356331145749819
+
102658847092504
+
497003148825168
+
202359692308749
+
378179874893748
+
288190427639734
+
67215625812110
+
93836607837463
+
39963768403407
+
461513540873237
+
54758410728278
+
469151923616890
+
166921111216013
+
172094825320701
+
401988768026836
+
72359177616839
+
73996848337616
+
156027952163011
+
80550172897080
+
272407697592724
+
319010392655020
+
105513600420820
+
162726193523288
+
535986651356692
+
436612082177264
+
212069750441845
+
524009300711044
+
3906518069903
+
511762793424455
+
435458211326830
+
182645647469308
+
386479321392427
+
547154129474513
+
189861778530296
+
538429181270504
+
507550826426915
+
444356931927172
+
358258263704862
+
479009393218306
+
124637474760302
+
48105008177613
+
79260117487309
+
174911990213797
+
500298985584761
+
326954412173914
+
295336439807937
+
395949666733917
+
443370872863471
+
318697699565865
+
427947513844159
+
511045858671785
+
203280107417109
+
6700597080245
+
348384357592517
+
374376031983939
+
260753794641180
+
56191981851288
+
97355512125554
+
60506801192793
+
84565744031887
+
488814694065249
+
161260860939794
+
337637633215227
+
173783730103701
+
142086002223119
+
207574240730436
+
436871109820151
+
461408177154461
+
382258137884632
+
440730273321561
+
159229941436332
+
166460057869524
+
15683339825778
+
68381063771276
+
143598887912420
+
96653310252281
+
234747364980280
+
128261783917087
+
103021515222116
+
477480443511452
+
114836796393351
+
176449720440695
+
275945902507716
+
99018309358801
+
254514953778996
+
471192665544357
+
358710048656100
+
469155211803836
+
203392280667538
+
192303210311382
+
15133914751416
+
263057847298987
+
304201025028695
+
109141830415556
+
62185120729939
+
347423458432248
+
1593697889240
+
4336364389626
+
249534740021091
+
245022245155666
+
378597629224414
+
217930033733263
+
47800102644184
+
138075535369981
+
357729021453863
+
349551010555520
+
414887370914099
+
395344795419827
+
521156568954976
+
272534129891028
+
371964108827244
+
227896489799466
+
249887136596757
+
16884793154524
+
317821877138354
+
81898773447364
+
443073486047140
+
247847253283552
+
315251502366423
+
102188123805733
+
303075733196562
+
557745658198349
+
206799637439489
+
451334768708210
+
97037065675992
+
257278920415657
+
56437781998953
+
44288968074472
+
113292234978530
+
151922731113530
+
391052761602056
+
267944508540614
+
343200180160422
+
288399431199285
+
93273619500930
+
75721595033881
+
550871884021335
+
149604081990381
+
512742597104092
+
455839846395368
+
445378642797525
+
16014807365216
+
30695616425451
+
43049956446441
+
270535131219725
+
4693914659902
+
335914961222544
+
272323132654404
+
528950169623633
+
445047908810129
+
419646793721765
+
213936570355528
+
395125528944776
+
141671410426457
+
453372985670055
+
222478883363391
+
439875818936907
+
303299784024612
+
56388748078988
+
318257306432227
+
215338536256842
+
532406515670856
+
172904036406734
+
25079121055090
+
326898571184918
+
383895798528344
+
416303301754527
+
490848856553941
+
320988109028453
+
223845273980771
+
94966656581935
+
190179292225210
+
419218075147010
+
230508834223536
+
548901527044748
+
297819409510702
+
464859798986245
+
118169686522273
+
207497906150129
+
512346201207054
+
1158097103310
+
459046195527588
+
186759288128078
+
96944724188350
+
392594151513159
+
234466454560389
+
68623818756541
+
246226233532203
+
114619533725580
+
493869659303676
+
313637481743263
+
534137643816612
+
264642463242404
+
377529710233522
+
87155833011856
+
35770041890308
+
516647262550256
+
265354534106177
+
406005422023368
+
272642225302759
+
85930020547676
+
284783735206766
+
436630505082911
+
15951172389804
+
444797637969258
+
97363222190880
+
133445802169347
+
272305925709773
+
548458915170143
+
430806456961455
+
245507121943314
+
160249013035249
+
527709486106910
+
367001001737708
+
518162583986624
+
183225672376704
+
296993625361143
+
231639876629108
+
407962526353092
+
67393637407153
+
85833159363453
+
49339824913993
+
28400800168478
+
15327853771250
+
354370364188649
+
201574969117946
+
552709965745032
+
213632623033074
+
312504618210213
+
327125906582053
+
144452289727950
+
203987516214332
+
479509321715515
+
88372152498413
+
307473270739765
+
245675091013202
+
336432122026158
+
41324911865648
+
458457956208945
+
542446938157188
+
89589403513696
+
24781388955739
+
305437870582706
+
348288413987487
+
431709614168751
+
276141784590342
+
466981918128601
+
372707468387142
+
102568457788486
+
349718918963076
+
104093272014233
+
265342553887934
+
339579325422624
+
516419655842307
+
325305930926652
+
409419378044930
+
290691078464777
+
538500176586611
+
104911135244051
+
460656158588869
+
19085848624265
+
550573802219161
+
22745479349256
+
65579588599422
+
254111896868958
+
43567781834275
+
90573006423916
+
45561710350423
+
149209374428586
+
446575143276470
+
550306254135662
+
181025204938463
+
97330974107531
+
379402147450993
+
241506356892172
+
168713148733973
+
48466869897953
+
528008864607078
+
393115054851961
+
165787328717415
+
287310392177289
+
551681935207092
+
122167522220188
+
132105403007176
+
317705294863715
+
109910998040619
+
446000068071441
+
235531799669044
+
146356734397746
+
47298585536802
+
42273110218235
+
444603089915716
+
241465851395725
+
109573813906530
+
231274862902914
+
537319538622584
+
157414189612508
+
221642178690563
+
245610078329995
+
528325158959332
+
145325570078081
+
12079144762793
+
531588757842283
+
547678261102872
+
127153144140359
+
305742973421716
+
8011027076203
+
477661996505800
+
466477744603636
+
403328720663418
+
507927453967381
+
538069184299013
+
214768582354766
+
137397594359581
+
187613809609389
+
357880338028129
+
433487759782156
+
487471717210901
+
180006387715886
+
326002409470383
+
76444888756813
+
444254908195532
+
148806304277047
+
479844016063762
+
330052487223106
+
240176280384525
+
411385336296896
+
354792309945488
+
305594460678296
+
40995915706785
+
39394966701507
+
89548663321944
+
548307369875750
+
488506179147436
+
121924775887669
+
148038179339071
+
338537681759411
+
468669066514854
+
184481225100823
+
360687191874324
+
489917124737512
+
183480059346292
+
210032333691837
+
415012143178873
+
425782508042329
+
206536230476631
+
69446550967892
+
456998663839841
+
487684484253300
+
132781025275839
+
51299076795592
+
214996080875736
+
395997740442896
+
229801883331266
+
410891218970154
+
44342335653173
+
468644958332092
+
133694753338744
+
15324257575984
+
382577259399786
+
371176455304440
+
273103366140744
+
473864877490707
+
348672546656929
+
346325654887690
+
204798752414288
+
205451628438977
+
2248039977575
+
236557577288755
+
246505641659146
+
441573876295181
+
554299527848615
+
368147889057080
+
337980441560978
+
108843538156956
+
214211872574501
+
222501948465259
+
199340300341502
+
57751894058447
+
387301004745509
+
555684169567228
+
444161010809973
+
44274057183558
+
457484483808702
+
299118893791597
+
278770127821305
+
19364490860923
+
269877412509975
+
362138446785346
+
407915043906975
+
110542007795632
+
351373538617793
+
178613301456939
+
419145884127302
+
337724653316807
+
273150978486771
+
314964765668119
+
471968715772891
+
357610841553825
+
22133316659832
+
208155444980927
+
509198516401694
+
411253902813469
+
227031471430627
+
446602597121154
+
271273314812585
+
415798095859971
+
561190340020923
+
336975452894927
+
143875972527564
+
290796527780450
+
562533759378622
+
116821329895853
+
386671228899496
+
317327089314224
+
183632275635096
+
273373429456521
+
129515707014799
+
110676169506793
+
233033183096270
+
318333250308412
+
112033225565880
+
519454679823055
+
55656519297819
+
377451642372971
+
338691010626694
+
64777634972758
+
436208855797645
+
415156993450774
+
98020363049302
+
42655570576535
+
34400406221986
+
290610597270086
+
537265183350038
+
400911093968583
+
525318854899855
+
248415410979120
+
418842405171486
+
411566017836771
+
425657631898340
+
354259572729994
+
268446068326870
+
296070266615673
+
136227729615321
+
120047629033730
+
406964876482178
+
137521850223080
+
92611826977927
+
331877322852943
+
479781531711867
+
266206661846269
+
347578536598669
+
89240023766690
+
529174586943339
+
84839756252558
+
419979950328255
+
547500684314327
+
280045500991504
+
215483226398738
+
441596111446605
+
302694962708225
+
273892147226306
+
482132415192397
+
102702250742943
+
223089452700980
+
457807726448257
+
384562645765746
+
277781338567261
+
439822548783525
+
183776192242043
+
301325514128398
+
70021389620076
+
336918674037773
+
68295253195049
+
543695343432503
+
111249314175356
+
7690585447477
+
309542200032252
+
103628229231634
+
73718547163740
+
159803357847773
+
430786036978468
+
415204380827690
+
48045918311352
+
517000580666897
+
325917367515042
+
426507802694299
+
526144643790360
+
513035119218192
+
315794526632610
+
285574806997324
+
276841825017615
+
179635895379213
+
325755181311001
+
524060550844191
+
91712045450912
+
77966935288136
+
264428541284938
+
524847707306416
+
111105350913783
+
346301400064114
+
556613923238451
+
472099250670418
+
371207522154824
+
451823217286595
+
357256514424263
+
372048331394790
+
434691928665739
+
560829027337169
+
16136507872053
+
282364153898411
+
154085261680230
+
254154288276590
+
514028216189442
+
545333427544222
+
476497025736792
+
242355804527146
+
561598070577352
+
118400176536972
+
375682605796962
+
399133654154343
+
201628057251316
+
217572056496332
+
533395907107346
+
47345345286797
+
7408156832896
+
522616875123776
+
349641074502968
+
345818104113036
+
438218046900677
+
31628293548083
+
351605047809133
+
359444834536162
+
290228149997469
+
135905576277424
+
84612883197372
+
189982680788991
+
450138577332891
+
136439932241119
+
187799240856577
+
68578204608926
+
134334871260185
+
291561127203042
+
273974000047959
+
174624183735646
+
18383048241682
+
556252702946152
+
387793821456466
+
298566510001603
+
172815513476927
+
33902411018515
+
555994633611969
+
289184312520430
+
436658715830883
+
470864228533567
+
164090356849964
+
98782919658558
+
97942176959956
+
112901798817150
+
35208936896656
+
14353996552438
+
471473766116537
+
480180311744636
+
499204584847002
+
80611198707461
+
544525064031093
+
229232247132363
+
162849540618442
+
492975074294900
+
166448581711132
+
114764389841759
+
63292143206629
+
98480857792796
+
157851646383721
+
253474206387522
+
354978928842494
+
278747160618146
+
4530472691471
+
58079854789591
+
66267035140727
+
311056476691269
+
557762351202903
+
197758525541161
+
437268149565806
+
313236543511296
+
302427918967126
+
400691760604857
+
399668277458282
+
223494949882340
+
46570814488202
+
204451824914507
+
345698026918708
+
497928342405563
+
325773432317635
+
93545891401889
+
5585896974427
+
356380459100139
+
264230752597112
+
426543387431711
+
387146966449194
+
41228535640790
+
509087992955574
+
489729610164135
+
416479576139310
+
28845488051941
+
522009267546744
+
271000859618955
+
283750554123411
+
410419160607446
+
185499005938127
+
471551666427620
+
58626479872089
+
42972264624877
+
524613104175528
+
27852888528989
+
237204455550497
+
288326266418244
+
63065149157014
+
553756535652764
+
282436178910576
+
88402747933723
+
400823646916103
+
223363824772513
+
525071673732969
+
537259982319875
+
276682773539699
+
398451590620752
+
245054501306549
+
464479921104086
+
457043633831813
+
516586215954486
+
64884357708824
+
56128129974389
+
152412022204482
+
222723024889271
+
199274377091885
+
477985828686667
+
461997935560695
+
544878475633187
+
173350091865783
+
28043191569632
+
550154791633306
+
95957091506410
+
148749440627953
+
363647261163259
+
137891120244035
+
292700540347170
+
7279385311717
+
127148348879474
+
470000742634139
+
144166016173754
+
394128803397657
+
361074837077952
+
126989419234613
+
420362060242891
+
404091808985110
+
118996430880710
+
108513159619332
+
245110820984873
+
404371687077287
+
92684280085493
+
109303133175033
+11
day_5/mini.txt
···
···
+
3-5
+
10-14
+
16-20
+
12-18
+
+
1
+
5
+
8
+
11
+
17
+
32
+25
day_6/6.c
···
···
+
#include <stddef.h>
+
#include <stdio.h>
+
#include <stdlib.h>
+
+
+
int main(int argc, char* argv[]) {
+
FILE* f = NULL;
+
char* line = NULL;
+
size_t size = 0;
+
ssize_t nread = 0;
+
+
f = fopen(argv[1], "r");
+
+
while ((nread = getline(&line, &size, f)) != -1 ) {
+
printf("%s",line);
+
}
+
+
+
+
free(f);
+
free(line);
+
+
+
return 0;
+
}
+5
day_6/mini.txt
···
···
+
123 328 51 64
+
45 64 387 23
+
6 98 215 314
+
* + * +
+