2018-12-23

Day 23: Experimental Emergency Teleportation

Description:
--- Day 23: Experimental Emergency Teleportation ---

Using your torch to search the darkness of the rocky cavern, you finally locate the man's friend: a small reindeer.

You're not sure how it got so far in this cave. It looks sick - too sick to walk - and too heavy for you to carry all the way back. Sleighs won't be invented for another 1500 years, of course.

The only option is experimental emergency teleportation.

You hit the "experimental emergency teleportation" button on the device and push I accept the risk on no fewer than 18 different warning messages. Immediately, the device deploys hundreds of tiny nanobots which fly around the cavern, apparently assembling themselves into a very specific formation. The device lists the X,Y,Z position (pos) for each nanobot as well as its signal radius (r) on its tiny screen (your puzzle input).

Each nanobot can transmit signals to any integer coordinate which is a distance away from it less than or equal to its signal radius (as measured by Manhattan distance). Coordinates a distance away of less than or equal to a nanobot's signal radius are said to be in range of that nanobot.

Before you start the teleportation process, you should determine which nanobot is the strongest (that is, which has the largest signal radius) and then, for that nanobot, the total number of nanobots that are in range of it, including itself.

For example, given the following nanobots:

pos=<0,0,0>, r=4
pos=<1,0,0>, r=1
pos=<4,0,0>, r=3
pos=<0,2,0>, r=1
pos=<0,5,0>, r=3
pos=<0,0,3>, r=1
pos=<1,1,1>, r=1
pos=<1,1,2>, r=1
pos=<1,3,1>, r=1

The strongest nanobot is the first one (position 0,0,0) because its signal radius, 4 is the largest. Using that nanobot's location and signal radius, the following nanobots are in or out of range:

The nanobot at 0,0,0 is distance 0 away, and so it is in range.
The nanobot at 1,0,0 is distance 1 away, and so it is in range.
The nanobot at 4,0,0 is distance 4 away, and so it is in range.
The nanobot at 0,2,0 is distance 2 away, and so it is in range.
The nanobot at 0,5,0 is distance 5 away, and so it is not in range.
The nanobot at 0,0,3 is distance 3 away, and so it is in range.
The nanobot at 1,1,1 is distance 3 away, and so it is in range.
The nanobot at 1,1,2 is distance 4 away, and so it is in range.
The nanobot at 1,3,1 is distance 5 away, and so it is not in range.

In this example, in total, 7 nanobots are in range of the nanobot with the largest signal radius.

Find the nanobot with the largest signal radius. How many nanobots are in range of its signals?

--- Part Two ---

Now, you just need to figure out where to position yourself so that you're actually teleported when the nanobots activate.

To increase the probability of success, you need to find the coordinate which puts you in range of the largest number of nanobots. If there are multiple, choose one closest to your position (0,0,0, measured by manhattan distance).

For example, given the following nanobot formation:

pos=<10,12,12>, r=2
pos=<12,14,12>, r=2
pos=<16,12,12>, r=4
pos=<14,14,14>, r=6
pos=<50,50,50>, r=200
pos=<10,10,10>, r=5

Many coordinates are in range of some of the nanobots in this formation. However, only the coordinate 12,12,12 is in range of the most nanobots: it is in range of the first five, but is not in range of the nanobot at 10,10,10. (All other coordinates are in range of fewer than five nanobots.) This coordinate's distance from 0,0,0 is 36.

Find the coordinates that are in range of the largest number of nanobots. What is the shortest manhattan distance between any of those points and 0,0,0?

Input:
pos=<35736475,5268315,44141623>, r=68945144
pos=<98249648,35180107,46324866>, r=99363158
pos=<-33547541,25677708,29822965>, r=91044586
pos=<18997357,27435558,22203548>, r=51976657
pos=<9999306,44070497,46228534>, r=60389933
pos=<-11232017,15711495,38725419>, r=69792763
pos=<69735987,47669658,46708342>, r=57976671
pos=<108348247,48092549,46991236>, r=95882854
pos=<29616366,30343943,25580230>, r=56310558
pos=<55771892,34986939,14417116>, r=88986230
pos=<-4076452,46003840,-27660246>, r=98730882
pos=<37806127,35544433,26100531>, r=58779554
pos=<28537325,-29968211,43996784>, r=97127437
pos=<175944061,22745049,18215615>, r=83019610
pos=<-7518172,50302588,20566683>, r=51741591
pos=<32973385,102732735,26399661>, r=93414748
pos=<27566699,32225307,2735607>, r=75224145
pos=<90765957,45380919,68169326>, r=99066859
pos=<17439378,-23734545,29591571>, r=94200997
pos=<37348398,35907697,1171310>, r=82887984
pos=<16668596,17585024,30949266>, r=50752838
pos=<43294910,55011497,6547354>, r=75867319
pos=<-39687235,73312930,41074953>, r=86412726
pos=<77600061,52837446,45466783>, r=69078996
pos=<79847020,47470311,46895275>, r=68099888
pos=<41161959,-11459287,37418030>, r=97821876
pos=<55243809,26266628,37349576>, r=74246269
pos=<28554372,56539455,11790628>, r=57411682
pos=<35376754,77309282,68931747>, r=68620223
pos=<80333063,47281103,44270109>, r=71400211
pos=<26282613,18846337,19865708>, r=70189108
pos=<81162185,36811904,29601881>, r=97366760
pos=<76518508,39246657,43222325>, r=76667967
pos=<49483399,13072223,23782144>, r=95247770
pos=<75407008,32771443,67266045>, r=95414250
pos=<20396216,32874538,18115050>, r=52025144
pos=<47518497,34143968,14694996>, r=81297906
pos=<58121018,46842064,20052637>, r=73844744
pos=<-25482904,58405932,58752491>, r=60023043
pos=<2414899,74909973,18437390>, r=68545229
pos=<93399797,56430242,41827270>, r=92111574
pos=<22057772,29819687,42910507>, r=84744225
pos=<58887283,37744860,27213147>, r=76547677
pos=<20511261,12176609,40616709>, r=50336418
pos=<27531206,5567327,11585926>, r=92996314
pos=<-11888301,36803758,23995873>, r=64086479
pos=<55138614,6254749,54369165>, r=88765526
pos=<27689879,48020738,33552377>, r=70404742
pos=<17399375,22091331,11617566>, r=66308859
pos=<-30063622,12388637,40670912>, r=90001755
pos=<35362839,37222182,9170045>, r=71588990
pos=<203530720,40857437,31304618>, r=97936573
pos=<71684320,41513849,32460452>, r=80328463
pos=<6832912,17923279,-10870456>, r=99111947
pos=<70541337,40514901,23109870>, r=89534942
pos=<-22356418,22728990,45454279>, r=67170798
pos=<21116887,35329043,40481972>, r=74431257
pos=<31626078,42426499,2331845>, r=69486096
pos=<64317834,61658521,38180749>, r=71903858
pos=<-52795703,46719036,38718342>, r=80355995
pos=<52774899,78131860,28428556>, r=86586505
pos=<32215639,16811727,25393141>, r=72629218
pos=<21974048,46228429,-17810448>, r=76175002
pos=<59234315,42744200,40747201>, r=58361302
pos=<50620475,95139824,34221129>, r=95647436
pos=<31524663,83545637,36393296>, r=62785299
pos=<-43702001,60251514,32749670>, r=85692014
pos=<47014566,71579815,66754620>, r=72351399
pos=<71588604,22705912,35843016>, r=95658127
pos=<88518450,40216724,54752646>, r=88566919
pos=<-60378893,29488684,44404684>, r=99483294
pos=<-11101653,79245668,34873217>, r=69961698
pos=<44936915,20055145,71895444>, r=82289701
pos=<-44992958,47946287,40495699>, r=69548743
pos=<46823746,44888999,1056656>, r=83496494
pos=<-36025436,54507898,22026426>, r=82994433
pos=<20587527,-24964792,34210791>, r=93959974
pos=<-147275777,18337543,40032704>, r=74216227
pos=<41111909,-13140154,40504911>, r=96365562
pos=<28252618,41639354,43825267>, r=79119691
pos=<64777674,43642375,38465261>, r=65289045
pos=<50314871,48086008,33304117>, r=51543138
pos=<52803279,52187826,33480017>, r=55619426
pos=<42764327,22650241,12311998>, r=90420773
pos=<36024431,23059804,20110184>, r=75472847
pos=<65070465,24199205,24785446>, r=98704248
pos=<21614823,44943481,40873083>, r=78906127
pos=<42135803,45316305,7170286>, r=72267592
pos=<60338695,24596400,68535461>, r=89790637
pos=<91847494,36602917,44174167>, r=93688975
pos=<42617883,45456599,2364062>, r=77415614
pos=<-17900452,26264040,46075639>, r=58558593
pos=<23065024,54683026,44912280>, r=79925134
pos=<7393618,13065147,24339203>, r=68199956
pos=<66409579,61821152,55522004>, r=70755419
pos=<-16465303,31827246,46650925>, r=50984786
pos=<63652634,35204424,42567838>, r=68499244
pos=<-33503704,33700462,30229837>, r=82571056
pos=<28323023,71484327,26373493>, r=57542097
pos=<28638640,42039332,41138992>, r=52702802
pos=<71640578,37211073,21580686>, r=95467266
pos=<-41000570,46965324,40040080>, r=66992886
pos=<76894429,46086205,25958626>, r=87468098
pos=<-2104680,19136731,39740387>, r=56225317
pos=<-24197801,50664690,29123122>, r=60226968
pos=<78990123,45644865,29732704>, r=86230964
pos=<-75727029,44926164,44902145>, r=98896354
pos=<31308722,45558616,9895068>, r=58473693
pos=<4366402,38123986,47281720>, r=95230204
pos=<95625327,59551444,-77297749>, r=57341892
pos=<62785679,81502394,31308615>, r=97087863
pos=<-15796059,72916646,38179244>, r=65020985
pos=<18491161,-132636,19831409>, r=81410854
pos=<23872265,29672987,5867691>, r=70950377
pos=<70800264,78761297,46375689>, r=87294333
pos=<29356716,5693454,18985832>, r=87296130
pos=<24908148,26208701,2213603>, r=79104220
pos=<66837058,30632466,35443185>, r=83379848
pos=<34758918,14455953,51851302>, r=57666779
pos=<54033957,17306737,38736710>, r=80609003
pos=<48708931,41607919,37147697>, r=52571767
pos=<-589665,74402116,82826728>, r=75200417
pos=<104827312,44510775,45564490>, r=97370611
pos=<16914008,-5653659,34384768>, r=70801459
pos=<20021121,-10501160,45627107>, r=67513655
pos=<26852275,85491857,44735094>, r=51717310
pos=<17505657,7026134,65101229>, r=61093244
pos=<-55850355,27721263,54572745>, r=98593809
pos=<90722224,39374348,46408572>, r=87557755
pos=<75712788,47079590,41284423>, r=69967135
pos=<-20098667,80444558,16622292>, r=98408534
pos=<-6183342,53541207,-17315146>, r=91527240
pos=<74050808,67317078,33746975>, r=91729179
pos=<54343750,38615989,93193128>, r=94433797
pos=<-5682328,86361229,20285787>, r=86245296
pos=<62616200,14021719,39538183>, r=91674704
pos=<18076520,56782799,72306919>, r=99500690
pos=<25035042,46689028,-14950654>, r=75915233
pos=<44009109,28898114,41196461>, r=56532945
pos=<-37907339,58047707,13717933>, r=96724811
pos=<-187456522,36438102,43373346>, r=67272291
pos=<42609408,29331524,12947311>, r=82949011
pos=<-34091899,66998918,59222950>, r=77695659
pos=<21320292,30995210,18116462>, r=54827457
pos=<-35162362,37777932,13653808>, r=96728256
pos=<-28240962,57549303,36590434>, r=63687396
pos=<53576376,36200124,36144896>, r=63849798
pos=<45336817,45251822,18873424>, r=63830112
pos=<-22707479,37411073,35715277>, r=62578849
pos=<40230216,57454752,95174584>, r=79862068
pos=<59394402,27523746,18638104>, r=95851003
pos=<88516125,41197150,40930949>, r=89006386
pos=<67918123,48121345,6145417>, r=96269722
pos=<52126865,27095082,86460873>, r=97005363
pos=<27227299,-18178187,62306972>, r=93225082
pos=<-52776428,19141315,50163425>, r=99690435
pos=<7041041,73555120,46658718>, r=70803069
pos=<57128675,96955462,56836215>, r=97922737
pos=<54449598,39543556,42204757>, r=55319856
pos=<64335579,45020796,21767560>, r=80165742
pos=<-10953426,35883853,72893055>, r=63854399
pos=<-4190893,64549410,77887691>, r=64009634
pos=<63151021,45773096,45935136>, r=54061174
pos=<34548926,20300660,27453916>, r=69412731
pos=<51843539,38693218,34049205>, r=61719484
pos=<44387978,51031179,8721243>, r=70806158
pos=<59223378,44844401,59074782>, r=58966408
pos=<61304375,46368851,54526663>, r=54974690
pos=<68152456,22248517,46227589>, r=82294719
pos=<18339974,-5788972,63757444>, r=73398926
pos=<57538247,45718816,28488332>, r=65949533
pos=<8913814,-12458905,33265853>, r=83277038
pos=<16791601,13698532,12465629>, r=73245867
pos=<73788319,54065233,38631376>, r=73330460
pos=<107019791,47183191,46696404>, r=95758626
pos=<27086216,46495998,2060349>, r=61148476
pos=<84492299,48203216,39343804>, r=79563639
pos=<49703995,33106963,44981015>, r=54234420
pos=<41387363,71321738,39509986>, r=57307429
pos=<-3676647,73532276,29728496>, r=61968152
pos=<32178381,21984325,84180197>, r=79886828
pos=<-7069263,47417372,21236800>, r=51412727
pos=<30301905,45665804,85726216>, r=55875295
pos=<49297738,17850032,57142847>, r=74103135
pos=<41561820,8727671,33335040>, r=82117473
pos=<-43781510,33486286,38940865>, r=84352561
pos=<64076551,42015352,-101902867>, r=50498200
pos=<-19931867,48178934,33747288>, r=51003449
pos=<48825639,37857409,83237873>, r=79718665
pos=<52754055,54074845,30871190>, r=60065992
pos=<23710745,38605907,-4774784>, r=72497986
pos=<20100858,45307027,-19905476>, r=77317736
pos=<51989289,39999030,27113427>, r=67495320
pos=<13124305,40302301,-2002745>, r=61573777
pos=<67333830,64297659,37758704>, r=77981081
pos=<-6206707,30586474,26208321>, r=62409597
pos=<43829193,6417845,33763264>, r=86266460
pos=<17441312,-3276117,46331101>, r=57004923
pos=<-5811539,67444586,34653790>, r=53090097
pos=<68574352,40336927,40977103>, r=69878682
pos=<41825475,46893199,42551899>, r=65263400
pos=<42543839,30413383,21732752>, r=73016846
pos=<54017489,43310312,43147046>, r=50178577
pos=<21356984,45064785,45699790>, r=95382140
pos=<56047348,39293098,44816599>, r=54556172
pos=<31012313,-810216,35010177>, r=79430729
pos=<20548415,23427947,50386534>, r=55974101
pos=<83730679,35320880,35929550>, r=95098682
pos=<-31137295,40318031,44440067>, r=59376839
pos=<28766416,51774559,1709817>, r=62939486
pos=<-14625904,24101034,41655322>, r=61867183
pos=<38852614,90776048,36288511>, r=77448703
pos=<32782342,38841848,-3575742>, r=80134716
pos=<93144002,43891300,33538220>, r=98333022
pos=<31170005,42947708,37646677>, r=64444426
pos=<21097695,37432740,45253045>, r=67959464
pos=<34685485,25162272,41906424>, r=50235239
pos=<57801108,28735238,65912151>, r=80490652
pos=<66008687,22000710,46643748>, r=79982873
pos=<75031283,42124842,65292374>, r=83711450
pos=<4314807,21493748,37255215>, r=49933897
pos=<30191609,11668271,6324880>, r=94816823
pos=<17367539,65981694,57542607>, r=95842811
pos=<-28473549,42977346,35446488>, r=63048072
pos=<37223961,67290016,81894566>, r=73410945
pos=<79638394,38789373,36923054>, r=86544333
pos=<55426104,14105266,42298311>, r=81640923
pos=<-21879323,106239503,44120331>, r=98486095
pos=<-125107,39446044,11813301>, r=61863422
pos=<25471056,28888510,14288615>, r=64912401
pos=<26040713,-937694,33260097>, r=76336814
pos=<26146255,5138662,13390128>, r=90236012
pos=<-31600050,46188373,24574225>, r=73835185
pos=<38701928,50721403,-15619730>, r=89151831
pos=<-62241067,45831496,32278384>, r=97129012
pos=<20062556,37906685,-793875>, r=65568196
pos=<82392638,51991373,45837286>, r=72655021
pos=<96740744,55028844,43580747>, r=92297164
pos=<36356721,29153145,13541303>, r=76280665
pos=<3079865,36558003,4307974>, r=69051802
pos=<80867329,62476685,53187768>, r=83534175
pos=<42484950,25640433,47378396>, r=52084513
pos=<75958750,40394046,37982939>, r=80200200
pos=<29644031,40847960,56546097>, r=51384581
pos=<38435552,3322493,34653481>, r=83077941
pos=<-31221495,46982605,44374419>, r=52862427
pos=<-28423714,36081949,52968024>, r=61201574
pos=<28016904,22899945,20572393>, r=67162992
pos=<86298312,43104046,38408210>, r=87405045
pos=<60693649,74876518,46712644>, r=72965794
pos=<22566696,48065309,56798978>, r=58303861
pos=<22859392,32036957,-13067634>, r=86508478
pos=<28179535,8102799,45263720>, r=57431406
pos=<59144734,38297774,44640215>, r=58825116
pos=<25398427,83962413,12916227>, r=80552853
pos=<55592927,37186002,42591816>, r=58433808
pos=<-10125545,53516203,-17317432>, r=95447056
pos=<75808705,37788820,58643982>, r=82176381
pos=<41582059,39353159,27704214>, r=57143154
pos=<36803982,39355205,-3606646>, r=83673791
pos=<-47369219,53669223,52952969>, r=71373292
pos=<173669415,26884632,8820116>, r=71245061
pos=<64230471,11859745,45688728>, r=89300367
pos=<-27995389,46478149,44011250>, r=50504006
pos=<64473597,40967985,29294451>, r=76829606
pos=<25626639,2500140,63776164>, r=72415149
pos=<40692851,779372,32287262>, r=90244577
pos=<42543510,50835442,77328557>, r=57710094
pos=<53123916,88806838,38591588>, r=87447575
pos=<16755624,94346153,37553592>, r=57656465
pos=<73517767,51897005,44233258>, r=65289793
pos=<42254027,44801184,43191862>, r=91192046
pos=<-15181467,39110959,-1260032>, r=90328480
pos=<35670950,45587984,-8157326>, r=80858652
pos=<34184905,72353269,33496591>, r=57149825
pos=<32484778,19554133,947384>, r=94601902
pos=<30709295,45482776,34168006>, r=83608882
pos=<-35663744,67855128,71173420>, r=92073973
pos=<73290429,44934629,24008003>, r=86966267
pos=<22676200,70440578,5275779>, r=71949242
pos=<41520507,14891289,20432424>, r=88815486
pos=<59842801,43646981,44363468>, r=54450816
pos=<-4916364,38616567,42725884>, r=64463717
pos=<48351155,1597262,37357878>, r=92014388
pos=<63495534,34021892,28309017>, r=83783006
pos=<25250062,47123617,62396321>, r=53909007
pos=<62790330,20464052,37883023>, r=87061827
pos=<71971005,23513326,33376228>, r=97700266
pos=<10528816,46412160,-23305683>, r=79362401
pos=<33637997,29425119,23496000>, r=63335252
pos=<57419524,68187124,36263879>, r=73451039
pos=<53254197,44600779,61357054>, r=55523521
pos=<40827842,3720677,21472120>, r=98253647
pos=<-17748085,18576383,64823922>, r=79887411
pos=<78665184,45003396,44757601>, r=71522560
pos=<53767106,32431138,20299469>, r=83654870
pos=<74847810,39924597,57276043>, r=77711777
pos=<24365495,45522857,7644670>, r=53816385
pos=<82075921,45443304,24670161>, r=94580825
pos=<34621400,22710712,18874959>, r=75654092
pos=<31050958,45147312,18369963>, r=50152149
pos=<81213376,47919375,51802051>, r=70608617
pos=<-844042,32262691,6661995>, r=74917166
pos=<62729359,33461460,37968140>, r=73918677
pos=<32706140,25474380,15799007>, r=74051123
pos=<23945607,35435689,38243998>, r=71152799
pos=<59161663,37698712,52570350>, r=59545887
pos=<34275822,3441498,78499343>, r=94846153
pos=<-30310796,27218265,39575900>, r=76514271
pos=<-15494634,51809425,46337900>, r=79213925
pos=<16518890,55686763,23806597>, r=54241024
pos=<-1642099,-717124,66675658>, r=84926883
pos=<56231780,35059664,26102393>, r=77688295
pos=<22593572,93919674,40144860>, r=60476626
pos=<37657872,45773327,88127331>, r=65524416
pos=<22476892,47520173,37175214>, r=83480001
pos=<54331823,22505668,62205764>, r=79544548
pos=<84522030,42886330,72027175>, r=99175491
pos=<16807848,46971712,2160054>, r=50294671
pos=<16672318,19597346,-15924534>, r=95617900
pos=<-10249549,26993089,35420067>, r=60834030
pos=<91683923,65817980,54924122>, r=99428407
pos=<55708054,25035363,29428815>, r=83862253
pos=<50876386,9826070,26003814>, r=97664862
pos=<17717868,24368638,17890637>, r=58077044
pos=<7384605,19458931,22149610>, r=64004542
pos=<48963393,2650623,31039167>, r=97892173
pos=<-9342873,88159731,33713163>, r=78277059
pos=<21457555,8927462,58632525>, r=56675131
pos=<49631578,177051896,93237>, r=85320742
pos=<32067126,45874591,46029926>, r=86081890
pos=<40952162,15824171,62562840>, r=73203345
pos=<49592086,71418075,44204589>, r=60914005
pos=<-48960646,35679830,63687694>, r=92860465
pos=<32084271,46857917,45439765>, r=64883093
pos=<27763836,48189586,42705793>, r=82463047
pos=<66290035,65556349,57990805>, r=76839570
pos=<5506247,22496264,33179413>, r=51815754
pos=<28619993,32142440,16560324>, r=62535590
pos=<27570667,20691494,37854488>, r=51643471
pos=<24646690,8238895,41097315>, r=57928865
pos=<35073091,4474311,77785928>, r=93897196
pos=<91622122,41359222,40217598>, r=92663757
pos=<65584506,51633167,51769992>, r=55990065
pos=<16337126,44503623,58891413>, r=89880074
pos=<19104009,54468378,42792930>, r=64313936
pos=<64403510,34173986,46315663>, r=66532236
pos=<61705500,-12772488,-64899370>, r=50271276
pos=<-20500510,59812197,76877082>, r=74571523
pos=<75571078,34155362,24546728>, r=99487358
pos=<38767442,74195235,25557110>, r=71513807
pos=<58821278,47883600,28542379>, r=65014403
pos=<-19913614,56456116,33263824>, r=57593435
pos=<45401158,27732491,30295381>, r=69991696
pos=<28210688,42955252,115124377>, r=85892319
pos=<77056212,44800972,63291576>, r=81059302
pos=<-153634158,52961156,86487574>, r=53913782
pos=<60764963,46813864,23522153>, r=73047310
pos=<68807586,35368171,21387033>, r=94670872
pos=<29800527,31242195,-12890602>, r=94067295
pos=<91347260,47311913,41218422>, r=85435290
pos=<108169748,50379245,46074213>, r=96583027
pos=<48108045,11607002,56212017>, r=78225555
pos=<30251881,32671784,106372573>, r=89465355
pos=<16354520,6351587,10808909>, r=81812519
pos=<31644977,21391372,38788873>, r=54083123
pos=<-8245917,-6759882,60046804>, r=90944369
pos=<-58332441,41088419,63812264>, r=96948633
pos=<68309096,45734718,80725559>, r=88812903
pos=<40805453,27546102,41847412>, r=54030302
pos=<75204822,28086882,44928071>, r=84808545
pos=<56959082,32590637,19125866>, r=87861239
pos=<29574801,61040117,15645371>, r=59078474
pos=<224274119,45373778,41437973>, r=50341391
pos=<85698263,58203614,34158353>, r=93851774
pos=<-13048571,56246231,-5836545>, r=89618907
pos=<27145454,23425174,15979443>, r=70359263
pos=<67655888,20005512,41924090>, r=88344775
pos=<63088451,40234211,45273635>, r=60198999
pos=<-47922846,38438365,74079442>, r=99455703
pos=<33680716,48227700,36879243>, r=69461305
pos=<82260905,35594899,47010135>, r=82274746
pos=<29412924,42139726,5857869>, r=64034014
pos=<24114275,47389874,51186019>, r=71748743
pos=<33024444,90536169,42405664>, r=65263253
pos=<11371167,6956819,57240372>, r=54804172
pos=<58022749,31830489,39979179>, r=68831501
pos=<37685382,28789274,27479191>, r=64035407
pos=<84649321,53172971,47011207>, r=74919358
pos=<18255531,27969820,1360932>, r=71543356
pos=<59626484,43637963,41696780>, r=56910311
pos=<71410691,17895082,57650353>, r=96678535
pos=<64094465,61468823,32202004>, r=77469564
pos=<27084040,5618226,32813065>, r=71271117
pos=<44943713,19544243,14672450>, r=93345395
pos=<55228619,45918033,41939845>, r=49989105
pos=<4682107,41422383,55281104>, r=77700220
pos=<71116902,56361031,45770157>, r=65816169
pos=<33474817,-12607391,45534934>, r=83165712
pos=<-61156206,47816996,38354336>, r=87982510
pos=<46901895,18473439,61998455>, r=75939402
pos=<33327733,20293626,35683315>, r=59969648
pos=<36916922,44070174,43868185>, r=98983529
pos=<22618513,23549677,94370103>, r=78951559
pos=<60840437,38218076,28572019>, r=76668870
pos=<28636875,38335671,10690587>, r=62228992
pos=<45925485,52158531,17580800>, r=64611539
pos=<45363877,102263754,46481159>, r=85254930
pos=<44980460,33252493,57808801>, r=55049572
pos=<55464357,48104843,65884359>, r=58756380
pos=<30031572,19035294,55488684>, r=51997493
pos=<88719356,46979545,26878761>, r=97479519
pos=<30738763,41030934,44939968>, r=75856324
pos=<-8819376,63657703,1197506>, r=85767119
pos=<76269562,48216842,47460819>, r=63210291
pos=<60903867,43657718,25860889>, r=74003627
pos=<60561080,22071594,71416552>, r=95419110
pos=<61247010,47911647,31374080>, r=64579948
pos=<34219008,30136010,2165072>, r=84536360
pos=<52887072,38944231,7612437>, r=88948773
pos=<78516471,31712466,63394984>, r=95711567
pos=<24025835,-21956417,61776376>, r=93271221
pos=<70473827,11983573,45922044>, r=95186621
pos=<52933327,19864906,20335993>, r=95350812
pos=<28979030,-25200486,45734023>, r=91063966
pos=<58202160,36258949,40339350>, r=64222793
pos=<62231301,37019662,43340280>, r=64489777
pos=<40681578,43296161,90431271>, r=73329322
pos=<59238548,36872583,40613447>, r=64370920
pos=<29751304,43789672,84375610>, r=55849735
pos=<28753852,17300631,15482614>, r=78589200
pos=<41435228,35381165,29035672>, r=59637157
pos=<225273308,48168301,37718187>, r=85101612
pos=<63068633,48242411,46944352>, r=50500541
pos=<20147771,-3329594,11512041>, r=94583718
pos=<80204707,64961318,46056242>, r=83218182
pos=<30781277,-14254649,32255611>, r=95398936
pos=<58830445,32420624,16271772>, r=92756522
pos=<48642106,31858295,46992921>, r=52409482
pos=<32959799,54680265,45320459>, r=78917762
pos=<-32119490,55793295,46799514>, r=55601222
pos=<-18664724,28991200,66963437>, r=72528726
pos=<45749180,26084051,45903119>, r=56380398
pos=<37586040,51050275,-1594445>, r=74339019
pos=<54177809,19511396,45169479>, r=72115342
pos=<55444678,38975806,45723305>, r=53364124
pos=<86209040,44550743,50891738>, r=78062556
pos=<18122590,55561509,40801560>, r=67063037
pos=<8677904,-10047295,31876403>, r=82490622
pos=<33820708,43590850,44703896>, r=57102558
pos=<38805266,85798481,40257047>, r=68454959
pos=<57180011,26881110,17309362>, r=95607920
pos=<25686418,45989065,93727104>, r=58937032
pos=<-43101760,38157115,47038899>, r=70903381
pos=<21964995,45581890,44046119>, r=82193150
pos=<-23323420,47271866,33826211>, r=55223414
pos=<55736991,20663228,40183239>, r=77509280
pos=<44735730,46370019,9108964>, r=71875257
pos=<61640724,53857365,19525599>, r=80080944
pos=<42276137,42930988,26611532>, r=55352065
pos=<37988421,-70979449,-21032141>, r=72032984
pos=<59457620,38100640,57967572>, r=64837102
pos=<82855937,40836121,46776107>, r=77862222
pos=<52688370,70642291,81795687>, r=92128763
pos=<61593124,80986059,46781923>, r=79905585
pos=<54601015,33411804,37799143>, r=66008433
pos=<41834171,20012355,45540791>, r=58899403
pos=<44228446,33467449,16672662>, r=76706724
pos=<34494083,19349733,92666891>, r=93323768
pos=<28982569,932776,47026263>, r=63642196
pos=<-43156327,19929785,46953626>, r=89270553
pos=<-27669180,43804653,45500756>, r=51361406
pos=<16452043,45240180,141269699>, r=97994189
pos=<27467325,40055075,122325881>, r=95250662
pos=<42154019,74430009,44738590>, r=55953692
pos=<-37274407,28447631,26885466>, r=94938945
pos=<41745454,25520718,46886292>, r=51956823
pos=<35677614,38593588,27947139>, r=51755258
pos=<46753480,43016124,28504130>, r=57851968
pos=<40969820,37166005,86455926>, r=75772264
pos=<37894958,33644760,73846377>, r=63609109
pos=<54539392,36538090,13615635>, r=87004092
pos=<68261317,51268753,35910945>, r=67727736
pos=<37474869,12272332,9945438>, r=97875732
pos=<23402477,1632186,44959927>, r=59428774
pos=<35149212,11740221,47466887>, r=58560542
pos=<59214783,47716128,39446207>, r=54670894
pos=<180680803,36261396,25489509>, r=87221280
pos=<78966778,50473977,46422968>, r=67126044
pos=<18244851,42413639,-2855944>, r=61305694
pos=<64765362,45184681,22682541>, r=79516596
pos=<19945090,-16772341,37578101>, r=81757805
pos=<45742891,13227449,19092546>, r=96041283
pos=<60679047,14321340,45056506>, r=83919941
pos=<86806250,43597486,47505994>, r=78321345
pos=<29636128,-3225886,-107112350>, r=72286952
pos=<40676164,28346333,15843444>, r=79104879
pos=<53593809,46196171,37925149>, r=52090869
pos=<41897387,46709952,20321695>, r=57484238
pos=<46543027,1506993,28594283>, r=99060343
pos=<54526315,31828561,25209884>, r=80106662
pos=<20670412,87478151,13238959>, r=79017849
pos=<88136574,46155056,50403105>, r=77897279
pos=<55187433,25508763,35906854>, r=76390400
pos=<49924929,42941299,25371457>, r=64230584
pos=<27061330,37705928,-6798795>, r=78772641
pos=<32102342,56182796,116968275>, r=92255964
pos=<30171939,36353418,-16142802>, r=92579705
pos=<88245554,45731267,46959899>, r=78172808
pos=<30087707,47158804,45966265>, r=96453715
pos=<20430437,15934639,29682571>, r=57431658
pos=<65294460,45703066,46535696>, r=55674064
pos=<75041779,47526379,44532051>, r=65601854
pos=<12472080,-14690223,68217992>, r=86327926
pos=<69539628,12366733,44375217>, r=95416339
pos=<84128321,40375010,70095524>, r=99361719
pos=<71916517,42879802,47368719>, r=64286688
pos=<43051438,45785658,22330232>, r=57553913
pos=<21977380,43341955,45399884>, r=68656165
pos=<38258083,16747657,9862913>, r=94265892
pos=<62094897,27837317,44007682>, r=72868318
pos=<18114823,43906418,43284601>, r=71491428
pos=<29129133,-16073443,33322324>, r=94498614
pos=<21130976,-13884317,30009538>, r=87624771
pos=<13811508,77444097,25738243>, r=52381905
pos=<56649016,63032526,57667611>, r=64352051
pos=<41097999,51424181,51694996>, r=80969320
pos=<97456798,40214853,54267090>, r=97021738
pos=<32811934,53553741,-26774827>, r=97248747
pos=<56311384,34239575,42225450>, r=62465400
pos=<40069680,42993703,22589017>, r=57105336
pos=<164079538,14215938,22583258>, r=61764366
pos=<73865061,19558358,43557663>, r=93367405
pos=<6631630,-2153820,45021772>, r=63498212
pos=<97380713,45919126,49849154>, r=86823362
pos=<13342578,-2285456,9437332>, r=92503529
pos=<62205800,24219677,67278388>, r=90777106
pos=<32621213,14212432,42589329>, r=58437928
pos=<2052606,46423073,40330202>, r=89690286
pos=<-9431871,52664863,85386236>, r=64864738
pos=<-41342790,48192522,38045705>, r=68102226
pos=<32864111,39380985,113379893>, r=92375511
pos=<-41952445,32881023,24527405>, r=97541818
pos=<-5167722,-1667756,66268539>, r=88995856
pos=<68584838,60150446,18049792>, r=94793974
pos=<25956717,47071394,4263321>, r=57240363
pos=<19271859,41623071,98574124>, r=61735638
pos=<-17368737,71412452,34384107>, r=68884678
pos=<29438470,24496614,105882418>, r=96337180
pos=<-2380208,75718231,33430244>, r=59155718
pos=<-42986081,43465564,33626112>, r=78892251
pos=<35958964,-1681004,32877752>, r=87380580
pos=<27779271,30039386,26134431>, r=54223826
pos=<72346093,21124897,38181732>, r=95657980
pos=<108396506,47185748,45063935>, r=98765238
pos=<-9891944,20097047,33217054>, r=69575540
pos=<-23937140,60090898,46338056>, r=52177641
pos=<17167908,20396447,77426370>, r=59710532
pos=<26301290,47747762,47325903>, r=74909490
pos=<72723730,62814757,31610220>, r=88036541
pos=<-22390633,18462760,36784746>, r=80140808
pos=<87591142,44318372,44565566>, r=81326275
pos=<86769705,30813192,53319004>, r=94788009
pos=<69787298,41315053,24710019>, r=86380719
pos=<-20413681,8607797,58509978>, r=86207625
pos=<23607608,42331063,37527347>, r=56916077
pos=<96714083,56729464,47247865>, r=90303985
pos=<70094315,40246780,45333245>, r=67132683
pos=<11215276,112276144,23163657>, r=92384847
pos=<47115647,30144169,33372392>, r=66217762
pos=<27553265,44039121,-13133502>, r=79266031
pos=<30034245,32578163,8932991>, r=71141511
pos=<83984852,45412451,29395087>, r=91795725
pos=<59139565,25501316,22164078>, r=94092540
pos=<57924303,46622502,66024521>, r=62839050
pos=<-7239474,-6259534,33115121>, r=93381581
pos=<87071301,40328352,40304971>, r=89056365
pos=<74569381,28995199,57235427>, r=88322134
pos=<48160565,39607929,24672619>, r=66498571
pos=<81475518,32784003,43510125>, r=87800053
pos=<38626197,87904709,39721815>, r=70917368
pos=<35747165,40702186,83515533>, r=64073014
pos=<21598430,-6386159,38384943>, r=72218055
pos=<92947520,47164515,46507417>, r=81894022
pos=<44040894,1518046,32331829>, r=92809416
pos=<-14388948,91104076,32948071>, r=87032613
pos=<-52548023,31433344,36391051>, r=97721299
pos=<-41181634,23239016,40318674>, r=90621786
pos=<49451827,38245889,33111285>, r=60713122
pos=<90222537,36132316,47061194>, r=89647551
pos=<35660535,110309094,42153980>, r=87923928
pos=<-18690820,43798331,24605330>, r=63284884
pos=<167168,3562386,45110858>, r=64157641
pos=<69856268,14888025,53212639>, r=93693523
pos=<-23825787,39176653,24877237>, r=72769734
pos=<32313064,42919066,106320518>, r=81227029
pos=<56833507,41812057,40804549>, r=56835261
pos=<-40534187,42817643,37975055>, r=72739175
pos=<16767136,14232271,224922117>, r=72922652
pos=<23079072,44933665,-9787616>, r=70551401
pos=<-7284521,58057844,45729719>, r=84043110
pos=<-10785778,42161255,28862157>, r=52760523
pos=<72479241,44635741,44639587>, r=65822388
pos=<44008071,19508414,54090620>, r=64102799
pos=<65808131,47764024,46891436>, r=53771077
pos=<83112262,-51380828,-5105145>, r=55811209
pos=<74905126,47284019,44585526>, r=65654242
pos=<71872446,21655380,42553995>, r=90281594
pos=<32115446,8958801,38878129>, r=66896988
pos=<72515585,46831447,42119681>, r=66182823
pos=<-12874762,27888898,26816399>, r=71167166
pos=<53831039,28814472,58681146>, r=69210467
pos=<-49321678,67419769,35733050>, r=95495930
pos=<68002822,20032291,45719887>, r=84869595
pos=<189351360,45117927,23876177>, r=56872364
pos=<84934816,47800485,35923907>, r=83828784
pos=<65517889,44974004,43846950>, r=59315298
pos=<-43831159,51010424,32021301>, r=77308190
pos=<37450636,53330808,2737077>, r=72152655
pos=<58231351,46927907,34441541>, r=59480649
pos=<-12810934,32577306,41950548>, r=51280739
pos=<73380795,47105479,66710469>, r=78498288
pos=<25356901,47492037,41664530>, r=50715954
pos=<64003068,59881008,54442232>, r=65328815
pos=<-40075891,51604006,46486310>, r=59681165
pos=<153334201,-33044471,46577857>, r=96012129
pos=<78438641,47597227,50955120>, r=67309135
pos=<22946384,27786511,15124441>, r=62653810
pos=<62553787,33989941,46916212>, r=64266280
pos=<51105402,65759012,9954507>, r=91018164
pos=<-24900518,48219394,-476648>, r=90155445
pos=<41989881,22264994,59360860>, r=64598270
pos=<-29738326,57316865,47259007>, r=54283702
pos=<21919022,-33935016,52412860>, r=93779388
pos=<25245179,46124275,46091357>, r=64434635
pos=<24955578,39475185,-24922564>, r=93021455
pos=<-45892178,37367365,43095553>, r=78426905
pos=<52501023,5481345,42096077>, r=87541972
pos=<-13911167,-12745183,41713449>, r=97940568
pos=<-28911568,31670297,34596140>, r=75642769
pos=<19562219,17410475,31693488>, r=53076626
pos=<86957311,47544195,34821735>, r=87209751
pos=<70289768,40042854,44324306>, r=68541196
pos=<57072271,28677711,18770322>, r=92242601
pos=<-52151426,43237300,25882720>, r=96029065
pos=<73952069,39286310,36810348>, r=80473784
pos=<37237798,77909432,22773489>, r=76482140
pos=<152168131,16009728,86757577>, r=93149955
pos=<47613795,-5021925,47363717>, r=87890369
pos=<78121275,47759377,36124823>, r=76855439
pos=<30076814,34632128,44042038>, r=71651672
pos=<74804987,43190961,19752430>, r=94479970
pos=<90334712,-37289880,256048>, r=67642155
pos=<43503434,85336249,26595917>, r=86352017
pos=<2980293,15468999,43264386>, r=51284132
pos=<65115975,47337473,22006556>, r=78390422
pos=<37008449,-2643621,47200042>, r=75070479
pos=<41137211,90372205,41797485>, r=73820225
pos=<-64252827,47925820,32145558>, r=97179090
pos=<67102166,22454880,45769044>, r=81496762
pos=<64701500,19817455,36417484>, r=91084978
pos=<52769485,-66218536,-5353280>, r=85328700
pos=<62238360,29123695,38742777>, r=76990476
pos=<18844687,12795099,-6782965>, r=95451044
pos=<100981065,-26489520,93249155>, r=76150209
pos=<-39422333,54509893,40439220>, r=67980613
pos=<22878359,29709115,71273679>, r=49955571
pos=<14085631,24270117,18489772>, r=56152591
pos=<33518558,30722444,35002562>, r=50411928
pos=<60936022,45972793,50912154>, r=51387896
pos=<-7445579,102223535,35054212>, r=89102457
pos=<4682901,30192896,45839381>, r=74949828
pos=<19434568,36202489,-14796468>, r=80646928
pos=<32206696,74733743,-5979619>, r=97028316
pos=<55713770,39561620,78530986>, r=80195808
pos=<43713031,36759737,20638611>, r=68933293
pos=<8615237,-8773464,17158876>, r=95997063
pos=<96558516,42787935,45347510>, r=91041518
pos=<33101773,40637201,24825455>, r=50257548
pos=<22407125,45023656,64347622>, r=82457916
pos=<52030151,46048917,24777173>, r=63822530
pos=<57036195,79223173,40756337>, r=79611365
pos=<-2170132,45131081,107549674>, r=80480567
pos=<51050410,47850632,34448776>, r=51369484
pos=<25167513,19962765,90206769>, r=80924169
pos=<29070471,36548953,14601603>, r=60538376
pos=<-21146462,39909597,21289883>, r=72944621
pos=<62216280,35735044,34466236>, r=74633420
pos=<65977992,58329611,44754170>, r=63661805
pos=<-21552625,67402861,41103046>, r=62339981
pos=<60562092,20825754,37920662>, r=84434069
pos=<4001078,-21286657,42676417>, r=87607044
pos=<-22228038,8647809,37651197>, r=88926709
pos=<48799002,51311725,10003434>, r=74215748
pos=<43551887,44538275,84540503>, r=69066674
pos=<48746740,72130796,44271965>, r=60713824
pos=<48886509,36511015,100683816>, r=98571801
pos=<66980685,28125857,67401549>, r=91769186
pos=<48593353,66088821,66993447>, r=68678218
pos=<20524135,48101742,106107975>, r=64042859
pos=<-19124807,32027195,82836083>, r=85825715
pos=<47569480,11226760,63140338>, r=84995565
pos=<20202453,9280334,55703648>, r=52138270
pos=<32688161,51066097,34763251>, r=83597889
pos=<82710541,47751450,46904922>, r=70672633
pos=<34179365,2981497,19674044>, r=94142249
pos=<-33395354,47290925,14075833>, r=85026271
pos=<-51808198,34414180,47196332>, r=83195943
pos=<44857240,28087691,27568423>, r=71819486
pos=<64976175,41347053,33082929>, r=73164561
pos=<33148616,-6805198,37518371>, r=85053840
pos=<7065942,52053193,45190101>, r=88227209
pos=<64550694,30508493,65173396>, r=84728337
pos=<86076794,55439556,32751312>, r=92873403
pos=<-1406442,47053164,32685101>, r=63215552
pos=<6658920,18650550,84946879>, r=75529173
pos=<30806048,-24912752,41929047>, r=96408117
pos=<-783986,16598228,69372816>, r=69450503
pos=<30118104,83553520,20362506>, r=77417879
pos=<95101840,60267613,47554238>, r=91923494
pos=<66858459,21490799,41471806>, r=86514767
pos=<8419134,78335855,14417958>, r=69986913
pos=<23831972,46591539,-15241158>, r=75100094
pos=<88278811,41226942,37240277>, r=92430001
pos=<53043274,50988314,9416872>, r=78722960
pos=<31586199,34179382,16054834>, r=63970411
pos=<29695716,36098205,17168611>, r=59047270
pos=<35080728,18632959,37612641>, r=61453679
pos=<31208595,24102808,19618727>, r=70105420
pos=<72071405,45343653,69974206>, r=82214638
pos=<194052441,35125806,30436049>, r=69115965
pos=<6353012,108782675,18604677>, r=98312817
pos=<33648026,-3881639,34713396>, r=85434690
pos=<98873732,40611985,55645707>, r=99420146
pos=<4151901,29783599,5726276>, r=73336437
pos=<-35663345,23003122,32418137>, r=93239720
pos=<97741124,37018991,43861838>, r=99478978
pos=<69212741,29380177,39725751>, r=82725174
pos=<32123583,43419852,5695371>, r=65626767
pos=<54532972,33923895,42207804>, r=61019634
pos=<57301703,77197157,46329819>, r=72277459
pos=<108424173,44278232,47117447>, r=99647199
pos=<36395377,24230102,44532391>, r=50251244
pos=<67601838,54357121,37297237>, r=68770203
pos=<-37626862,47137945,44052441>, r=59434259
pos=<59598951,33871782,33253293>, r=75092250
pos=<44481617,7084589,74815085>, r=97724780
pos=<68806630,39453007,59849138>, r=74715644
pos=<58920042,44014223,24823101>, r=72701193
pos=<67509762,51356770,41946491>, r=61028427
pos=<60188493,70305515,14888943>, r=99713471
pos=<71626305,51297132,47010644>, r=60021096
pos=<22138608,34007898,-4341113>, r=75090281
pos=<18001718,42993073,43251785>, r=85746118
pos=<40912684,3709364,34461045>, r=85360680
pos=<51839140,28949241,42381281>, r=63127053
pos=<35992778,7891852,12093118>, r=98626181
pos=<76945787,51163972,55226216>, r=70338464
pos=<63935345,45558212,24702472>, r=76293038
pos=<26437236,23029563,13866388>, r=72159881
pos=<37400014,26641299,28931022>, r=64446196
pos=<-54018552,38338679,54113978>, r=85685805
pos=<34913073,41916041,51893205>, r=58007995
pos=<28109593,70851984,66930558>, r=52894658
pos=<61830895,45985919,20593129>, r=77870207
pos=<45147970,35182809,35342598>, r=57240989
pos=<48881175,37845503,38503310>, r=55150725
pos=<-37047813,46613500,8875153>, r=94557007
pos=<35492708,31672157,-12518902>, r=98957937
pos=<116410423,-28840871,71482885>, r=59853369
pos=<-50471140,39007198,29020020>, r=95441560
pos=<30053748,-17546311,35216347>, r=95002186
pos=<43411934,34559082,11807568>, r=79663733
pos=<21025556,61949059,32046349>, r=86949892
pos=<22468662,61662234,16466117>, r=51773058
pos=<26155908,36269584,35660978>, r=56549699
pos=<32738886,43839059,-497106>, r=72015334
pos=<43778121,51542877,17400200>, r=62029041
pos=<77183326,50503514,53599094>, r=68288332
pos=<67548097,48099522,47096025>, r=54970918
pos=<-22125824,40235271,-1313077>, r=96201276
pos=<-14424515,32193172,6199337>, r=89029944
pos=<44352816,70613735,46768128>, r=52306690
pos=<81059472,38262735,62557471>, r=90866700
pos=<42490906,104763369,59748971>, r=94005941
pos=<-23524530,40541259,45745849>, r=50235298
pos=<27416580,24429378,34670003>, r=50935859
pos=<31036855,25236706,66243076>, r=57555714
pos=<70642218,54942800,33197332>, r=76495927
pos=<47419711,-2080193,40586443>, r=91532164
pos=<64299026,42403072,31799492>, r=72714840
pos=<60470181,34860031,23679516>, r=84549130
pos=<-21382100,62427490,25202788>, r=73094331
pos=<81706876,41024280,46322478>, r=76978484
pos=<54821813,38061176,7746502>, r=91632517
pos=<48200935,27967125,19764071>, r=83088108
pos=<58537003,46781516,38652604>, r=55721245
pos=<34985633,17404412,47452155>, r=52747782
pos=<-3108712,31722815,30965587>, r=53418668
pos=<-18436720,2127214,30927095>, r=98380066
pos=<48714893,39981069,30315783>, r=61036417
pos=<-26061006,43274258,37500740>, r=58283728
pos=<51484364,26833235,12305170>, r=94964353
pos=<19887872,8364082,38282858>, r=55859415
pos=<73299215,38828379,53010142>, r=72993755
pos=<-31205422,51822232,46560728>, r=50954484
pos=<61691605,47577855,83213442>, r=82840247
pos=<59702734,54033289,46476516>, r=51367798
pos=<4981119,8274587,33488960>, r=66252970
pos=<57922838,65684303,50789022>, r=61398530
pos=<-45105420,47548013,29362263>, r=81193205
pos=<78900713,30509094,50983176>, r=84887425
pos=<-63120028,32266292,45461104>, r=98390504
pos=<89495130,43658066,45806336>, r=82649123
pos=<-34501706,57247731,36769239>, r=69467730
pos=<74964282,24574993,49958465>, r=85860267
pos=<85467495,47933610,46473891>, r=73678358
pos=<-45673378,35582113,44881429>, r=78207529
pos=<98184759,45135708,38317516>, r=97349914
pos=<55182613,25170227,-90165307>, r=52821189
pos=<45807217,38649208,33776599>, r=56000207
pos=<-8216816,45029473,-2375189>, r=78560257
pos=<24818078,-16141049,31106706>, r=92470930
pos=<-12476743,36959833,-10223145>, r=98737722
pos=<67165820,30831495,44776212>, r=74176573
pos=<47886828,41148110,9419030>, r=79938097
pos=<91363632,37250192,39284499>, r=97447772
pos=<80609064,42079730,66734153>, r=90776008
pos=<47419015,34047530,75441081>, r=74325080
pos=<-5197243,16721489,47507670>, r=53965743
pos=<33750694,28379544,37954910>, r=50034639
pos=<72909890,46727204,43191496>, r=65609937
pos=<64651654,33892005,69853793>, r=86126328
pos=<79878375,46177923,46736599>, r=69582222
pos=<8249645,40040757,44109023>, r=90259675
pos=<38330826,65569564,59442519>, r=50345306
pos=<35411815,4433522,35455622>, r=78141095
pos=<63025772,36635016,42516316>, r=66492887
pos=<37446580,40380247,1605938>, r=78079204
pos=<1089996,43250991,-26556175>, r=95213337
pos=<27828905,95007369,86800902>, r=96639565
pos=<19110668,52578912,40284060>, r=55742297
pos=<76372399,44241005,22956104>, r=91793784
pos=<-1240607,34871772,5287819>, r=74078706
pos=<46232463,25775471,27535094>, r=75540479
pos=<18286640,131765767,45893005>, r=88267888
pos=<40604110,22648623,22147792>, r=78426132
pos=<42923353,30655608,3221863>, r=91664266
pos=<55573367,46792267,40537660>, r=50861805
pos=<84106865,32953082,38902369>, r=94869855
pos=<-28685087,54539326,14636561>, r=83075445
pos=<40226750,50631976,17430536>, r=57536431
pos=<3687987,17483520,37538376>, r=54288328
pos=<29932904,-1844569,35860416>, r=78535451
pos=<67747213,43453189,42286043>, r=64626525
pos=<60901308,32906306,25326794>, r=85286610
pos=<45610895,35264932,14560497>, r=78403887
pos=<82996698,38296441,37903613>, r=89415041
pos=<37830799,58947131,69667244>, r=53447584
pos=<94832479,43702506,50119088>, r=86761893
pos=<44171871,59242434,14425185>, r=73097506
pos=<52342042,35428607,89648893>, r=92075041
pos=<25058801,41184797,94510161>, r=63896666
pos=<86564738,36400305,40159000>, r=92623857
pos=<73522949,46397735,55732627>, r=68370474
pos=<24298221,43970980,39789590>, r=80894890
pos=<70468144,37200470,67491727>, r=86271887
pos=<1133788,104986973,32327408>, r=86013292
pos=<35294725,28215947,30270754>, r=59426386
pos=<-63072862,46893775,33424403>, r=95752355
pos=<38086339,21092695,29552034>, r=70059984
pos=<105837358,42834617,47321129>, r=98300035
pos=<22022089,12831374,38789575>, r=53019508
pos=<42189805,27065386,38307310>, r=59435695
pos=<68307575,45775054,17992050>, r=87158841
pos=<5570964,32668900,-14960049>, r=89717821
pos=<-151787334,26417604,67133557>, r=67932553
pos=<25214078,-10791264,26230718>, r=92393090
pos=<60455925,37217848,44680949>, r=61175713
pos=<73703211,46412915,25697772>, r=84210899
pos=<-9389980,29187610,77541625>, r=73635871
pos=<24317461,29888483,54881923>, r=99393546
pos=<27427502,22449797,33762673>, r=53833699
pos=<19484720,55851041,55343779>, r=99038550
pos=<51079119,15261048,32550262>, r=85886434
pos=<56458005,95286957,43097167>, r=92756096
pos=<-4189869,32270548,92923464>, r=80734581
pos=<36496626,11627368,17002182>, r=90485643
pos=<-39877725,29187907,35969273>, r=87718201
pos=<66758465,47231921,41704820>, r=60440089
pos=<20076711,26698184,43390319>, r=95921058
pos=<79369694,47163965,46829992>, r=67994116
pos=<37849498,48060836,16918832>, r=55488442
pos=<165679763,63705321,10687217>, r=60761014
pos=<91159196,30723794,50556110>, r=96504054
pos=<45973253,29295939,40318832>, r=58976848
pos=<53645666,44924810,39352382>, r=51986835
pos=<53662141,56799665,70828688>, r=68292867
pos=<41360452,32337273,25302745>, r=66339545
pos=<58339802,35964275,8223342>, r=96770725
pos=<17613634,2648041,41437745>, r=56146357
pos=<37974781,42580398,43976152>, r=90476863
pos=<54524244,30867303,16811842>, r=89463508
pos=<-33526422,40928905,34477452>, r=71117869
pos=<91566118,42276616,40151830>, r=91756086
pos=<46981419,96473551,65517966>, r=95975473
pos=<60257793,56509405,11153317>, r=89722152
pos=<23683330,51678452,-4543929>, r=64013964
pos=<58108951,51535018,43754798>, r=49997729
pos=<37773936,38380721,-4221101>, r=86232723
pos=<19416703,104260381,17816314>, r=89969034
pos=<12970739,19178311,10655221>, r=70193485
pos=<82665993,27655569,51973393>, r=92496326
pos=<-29837746,69094651,44081851>, r=69338067
pos=<28898553,-4488516,30052626>, r=85953160
pos=<81619209,59813841,39331918>, r=86209422
pos=<171457669,-12552454,46932029>, r=91259805
pos=<17112356,39136305,-24578365>, r=85172877
pos=<19194572,14786639,76534943>, r=66455485
pos=<-3476031,-139768,71529521>, r=91037172
pos=<95880606,44835038,42265119>, r=91398977
pos=<32774290,22313197,8157431>, r=84922023
pos=<63884479,47540794,25303754>, r=73658348
pos=<-13047695,-3863791,46962463>, r=82946682
pos=<64002095,86062732,35807486>, r=98365620
pos=<56134537,44586578,54536488>, r=51597055
pos=<1277122,78229234,-2363444>, r=93803332
pos=<-63306254,47910903,54520192>, r=85807355
pos=<95598595,40271767,46128668>, r=91816742
pos=<-9063115,26628548,17955355>, r=77476868
pos=<-39147904,48124557,28569808>, r=75451355
pos=<26873848,18846049,38186783>, r=52459466
pos=<63773014,19593400,54843300>, r=84535425
pos=<20593778,18286399,72132072>, r=59951957
pos=<23227862,61482669,46692836>, r=53712430
pos=<53526537,84503234,39959195>, r=82178888
pos=<79868937,19110265,-60803396>, r=72078665
pos=<52421424,40162463,43642011>, r=51235422
pos=<-16427834,36089174,36680227>, r=56656210
pos=<29393585,28300428,109541567>, r=96147214
pos=<3259445,-6467846,34169018>, r=82037081
pos=<57691330,59935904,22153515>, r=79582469
pos=<73876443,63756434,42212702>, r=79528421
pos=<51482469,65990806,27843510>, r=73738496
pos=<76843510,46385406,27516609>, r=85559856
pos=<-23182418,34095984,55291574>, r=60269801
pos=<46795846,44034285,34362684>, r=51017302
pos=<17535313,13508991,24689895>, r=61954789
pos=<30804351,70832968,9894298>, r=75851290
pos=<-30989231,24291012,37020026>, r=82675828
pos=<42844346,34723733,2366966>, r=88372153
pos=<53300566,-7021246,45659925>, r=97280601
pos=<-18884881,47987062,111541135>, r=98330739
pos=<30033962,-282555,35161370>, r=77773509
pos=<69228807,45277494,42766431>, r=63803280
pos=<39145878,45253565,44254260>, r=96368244
pos=<-41854978,46608611,39552433>, r=68691952
pos=<109141704,47542542,50054540>, r=97166459
pos=<54727565,47295932,28531331>, r=61518662
pos=<36485232,27730648,401307>, r=90971725
pos=<43888040,114722266,43356771>, r=99362057
pos=<203345467,35130560,35403226>, r=76234038
pos=<37850033,48088182,268360>, r=72111886
pos=<47173596,15638525,58719392>, r=75767054
pos=<-3725836,70759131,3332944>, r=85639684
pos=<28236569,10880725,8958357>, r=91016023
pos=<-7075582,65770053,34265006>, r=53068180
pos=<87150803,42780843,35311000>, r=91677327
pos=<18085200,43711061,962539>, r=56030160
pos=<76647777,46126618,57783548>, r=73817350
pos=<75720092,61171147,43732078>, r=77267547
pos=<101511028,46051483,58758378>, r=99730593
pos=<2501375,-21130928,51095534>, r=85617201
pos=<17255601,60931124,-2662199>, r=64957191
pos=<60928241,39741319,32494245>, r=71311144
pos=<40290108,-12330363,42903479>, r=92335378
pos=<89332198,46638319,38241363>, r=87071019
pos=<16465766,-14762728,29795639>, r=84051231
pos=<83946992,45319938,32385665>, r=88859782
pos=<51710586,22897610,77631498>, r=91956982
pos=<-19978367,16381145,16826174>, r=99768722
pos=<34506588,91711511,50024428>, r=63245024
pos=<48635003,9371488,40456276>, r=81425698
pos=<51451105,-360679,53170686>, r=90494961
pos=<86002985,43075618,39182127>, r=86363642
pos=<63451473,47897170,35010139>, r=63162531
pos=<45765295,53618906,46572448>, r=54105448
pos=<67982431,29563806,36215213>, r=84822022
pos=<7252558,21459622,13715670>, r=70569819
pos=<39155542,9628304,23450909>, r=88694703
pos=<69564813,55081791,67433902>, r=79083210
pos=<67109709,45181504,47428433>, r=57118272
pos=<26525614,21687012,22790961>, r=64666018
pos=<-15535104,65300544,25315798>, r=70007382
pos=<65487693,48063533,39034482>, r=61008092
pos=<49970856,18435302,59964573>, r=77012725
pos=<85282321,44036760,60372854>, r=87130962
pos=<42412226,21638106,78745610>, r=85032224
pos=<65945066,31842198,35733778>, r=80987451
pos=<56940122,58392056,44183826>, r=55256842

Part 1:
``````var input = File.ReadAllLines(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), @"23_input.txt"))
.Where(p => !string.IsNullOrWhiteSpace(p))
.Select(p => new
{
X = int.Parse(p.Split(' ')[0].Substring(5).Split(',')[0].Trim(new[] { ' ', '<', '>', ',' })),
Y = int.Parse(p.Split(' ')[0].Substring(5).Split(',')[1].Trim(new[] { ' ', '<', '>', ',' })),
Z = int.Parse(p.Split(' ')[0].Substring(5).Split(',')[2].Trim(new[] { ' ', '<', '>', ',' })),
R = int.Parse(p.Split(' ')[1].Substring(2).Trim(new[] { ' ', '<', '>', ',' })),
})
.ToList();

var max = input.OrderByDescending(p => p.R).First();

input.Count(i => Math.Abs(i.X-max.X) + Math.Abs(i.Y-max.Y) + Math.Abs(i.Z-max.Z) <= max.R).Dump();``````
Result: 417

Part 2:
``````class C3 { public long X, Y, Z; }

void Main()
{
.Where(p => !string.IsNullOrWhiteSpace(p))
.Select(p => new
{
X = long.Parse(p.Split(' ')[0].Substring(5).Split(',')[0].Trim(new[] { ' ', '<', '>', ',' })),
Y = long.Parse(p.Split(' ')[0].Substring(5).Split(',')[1].Trim(new[] { ' ', '<', '>', ',' })),
Z = long.Parse(p.Split(' ')[0].Substring(5).Split(',')[2].Trim(new[] { ' ', '<', '>', ',' })),
R = long.Parse(p.Split(' ')[1].Substring(2).Trim(new[] { ' ', '<', '>', ',' })),
})
.ToList();

var x_min = input.Min(i => i.X);
var x_max = input.Max(i => i.X);
var y_min = input.Min(i => i.Y);
var y_max = input.Max(i => i.Y);
var z_min = input.Min(i => i.Z);
var z_max = input.Max(i => i.Z);

long dist = 1;
for (; dist < x_max - x_min; dist *= 2) ;

long target_count = 0;
C3 best = null;
long? best_val = null;

for (; dist > 0;)
{
target_count = 0;
best = null;
best_val = null;

for (long x = x_min; x <= x_max; x += dist)
{
for (long y = y_min; y <= y_max; y += dist)
{
for (long z = z_min; z <= z_max; z += dist)
{
var count = 0;
foreach (var b in input)
{
var calc = Math.Abs(x - b.X) + Math.Abs(y - b.Y) + Math.Abs(z - b.Z);
if ((calc - b.R) / dist <= 0) count++;
}
if (count > target_count)
{
target_count = count;
best_val = Math.Abs(x) + Math.Abs(y) + Math.Abs(z);
best = new C3 { X = x, Y = y, Z = z };
}
else if (count == target_count)
{
if (Math.Abs(x) + Math.Abs(y) + Math.Abs(z) < best_val)
{
best_val = Math.Abs(x) + Math.Abs(y) + Math.Abs(z);
best = new C3 { X = x, Y = y, Z = z };
}
}
}
}
}

x_min = best.X - dist;
x_max = best.X + dist;
y_min = best.Y - dist;
y_max = best.Y + dist;
z_min = best.Z - dist;
z_max = best.Z + dist;
dist /= 2;
}
best_val.Dump();
}``````
Result: 112997634

made with vanilla PHP and MySQL, no frameworks, no bootstrap, no unnecessary* javascript