~talos/advent-of-code

80a315a7f17139d35f398a6e6ffe5145b030c092 — Jordan Newport 4 months ago 035860b master
Day 22
A 2021/22/input => 2021/22/input +420 -0
@@ 0,0 1,420 @@
on x=-3..43,y=-22..22,z=-15..34
on x=-9..42,y=-40..12,z=-30..19
on x=-5..46,y=-9..38,z=-31..21
on x=-27..25,y=-30..22,z=-9..42
on x=-25..27,y=-43..3,z=-22..31
on x=-39..9,y=-45..8,z=-17..29
on x=-10..36,y=-2..44,z=-9..35
on x=-45..4,y=-41..5,z=-3..49
on x=-24..26,y=-34..12,z=-6..44
on x=-35..17,y=-36..11,z=-42..10
off x=5..19,y=6..21,z=-21..-3
on x=-45..1,y=-40..11,z=-31..20
off x=16..30,y=-16..-4,z=21..33
on x=-38..7,y=-30..15,z=-46..3
off x=36..48,y=-39..-22,z=-47..-34
on x=-23..22,y=-22..29,z=-27..24
off x=-39..-29,y=-47..-34,z=-13..-1
on x=-18..28,y=-3..44,z=-8..38
off x=-38..-24,y=-48..-39,z=14..28
on x=-32..21,y=-36..9,z=-38..16
on x=-40114..-18236,y=44675..56621,z=-62989..-35133
on x=-47063..-26565,y=34232..54684,z=-70517..-34320
on x=-56151..-43929,y=48563..58124,z=36908..41850
on x=-77794..-42408,y=-69580..-49841,z=1311..11416
on x=-55821..-38492,y=49499..69556,z=17469..29122
on x=63143..77824,y=-46210..-33353,z=9878..30392
on x=39342..53117,y=-50110..-40820,z=-62170..-40938
on x=-73484..-48152,y=-65736..-42700,z=-18262..-13156
on x=37366..54383,y=19405..43152,z=47195..68515
on x=-58204..-27378,y=-43155..-25521,z=-62841..-54391
on x=-74420..-47151,y=37359..62719,z=-25475..-3046
on x=-45598..-17555,y=-26089..-5704,z=-70074..-64019
on x=-60861..-28014,y=-73554..-54991,z=-31524..-9823
on x=-24856..-677,y=-30123..-15884,z=63853..91090
on x=-70612..-48898,y=-58794..-27838,z=31988..51431
on x=-39272..-20927,y=-20393..-13252,z=-85528..-72953
on x=-25668..-4103,y=-18215..-1734,z=-91736..-74972
on x=-58040..-34891,y=-68034..-41896,z=22484..48325
on x=-83077..-63382,y=17005..35646,z=-28949..3129
on x=-75533..-63223,y=-47132..-32953,z=18181..35552
on x=-12005..9792,y=19338..25243,z=-92843..-67825
on x=56387..84965,y=-35767..-23866,z=-7517..29845
on x=41294..42717,y=62107..77449,z=-6076..18165
on x=68909..88527,y=12129..33752,z=-14973..1514
on x=70106..89265,y=-44616..-27968,z=-11036..-1697
on x=23822..38056,y=40195..55684,z=-65662..-33478
on x=57501..81938,y=-18907..-5701,z=5821..28274
on x=-25260..-17668,y=-48592..-46210,z=-69961..-51155
on x=-40924..-23866,y=59810..71028,z=1641..21630
on x=34547..43160,y=-74622..-56131,z=-36907..-17782
on x=-21350..276,y=14485..29856,z=-77890..-58230
on x=-75736..-39641,y=-2847..32980,z=-57010..-42061
on x=-25041..-10364,y=-77922..-57550,z=18525..31966
on x=-11867..7378,y=17836..49462,z=-90609..-54269
on x=-73484..-39680,y=-39303..-21793,z=31847..54382
on x=-16778..-10708,y=-66044..-52096,z=-44957..-39847
on x=-6352..5197,y=-48264..-42773,z=-69346..-65566
on x=-70366..-51952,y=-45555..-37939,z=-60527..-28534
on x=21301..42400,y=-20291..4389,z=66067..89444
on x=45669..82341,y=-56204..-41535,z=-21028..-14812
on x=-12687..6121,y=-75650..-50731,z=40334..49677
on x=62454..72648,y=-56206..-23070,z=-36904..-4173
on x=-14045..15260,y=74607..78556,z=3616..39536
on x=3027..21243,y=58402..67345,z=32845..51345
on x=36180..53611,y=3808..31420,z=-75144..-41742
on x=62333..81915,y=22152..45857,z=-19764..3026
on x=16840..31474,y=51862..63491,z=41052..56975
on x=34291..46927,y=-64612..-48527,z=-43496..-32299
on x=-15540..7128,y=28606..58975,z=61419..80612
on x=-41973..-18320,y=-77313..-61240,z=15692..47003
on x=-53801..-30362,y=39541..57030,z=-60083..-35312
on x=68377..77233,y=20169..50880,z=-27441..-20458
on x=-48517..-32670,y=27681..29643,z=43402..61515
on x=-27916..-4199,y=26661..49908,z=52384..82183
on x=49989..60432,y=-53633..-30668,z=-41268..-22103
on x=27313..55472,y=56100..75902,z=19430..45734
on x=-6356..15818,y=-68706..-57263,z=36276..50109
on x=-86603..-47010,y=-10414..18891,z=-47053..-29175
on x=-55452..-23629,y=-70516..-54860,z=1793..24906
on x=50625..72911,y=-12487..-2707,z=-71603..-40651
on x=39137..55253,y=19930..23696,z=45922..65211
on x=-9884..16104,y=-37553..-13090,z=-80288..-61586
on x=15247..32364,y=58299..77121,z=12794..38315
on x=-66919..-64795,y=27710..52508,z=-5853..20204
on x=55575..68137,y=-44413..-25743,z=-53783..-25185
on x=-28440..950,y=-58170..-37455,z=42708..66553
on x=-62883..-47411,y=41864..58827,z=-14578..6700
on x=-77452..-58620,y=-27879..-12335,z=28389..50389
on x=16287..41670,y=-20720..-3731,z=58921..81851
on x=-39948..-11682,y=62858..90995,z=-33475..-6506
on x=-56395..-35664,y=27367..43557,z=-61199..-44459
on x=-52933..-35603,y=-11996..5380,z=-73054..-57610
on x=-13683..-926,y=-79150..-68241,z=13231..23670
on x=-2283..11495,y=-47635..-35881,z=65101..72052
on x=68775..80912,y=-16331..4168,z=9807..29318
on x=-82722..-62858,y=28101..48460,z=-20008..-10603
on x=2241..10548,y=76361..96934,z=-22674..-2056
on x=54720..67218,y=-55890..-27903,z=-24408..-4708
on x=-29992..1612,y=7330..30747,z=-89965..-57543
on x=-26063..-23251,y=-14766..-5848,z=56200..88720
on x=25688..45780,y=48319..64535,z=29487..42809
on x=-10623..723,y=21921..25266,z=59433..79964
on x=9630..28513,y=-55849..-40790,z=59817..71724
on x=11397..35361,y=-80067..-68146,z=-50677..-32416
on x=50224..86037,y=-20267..-15219,z=-58574..-37744
on x=-46674..-23145,y=25112..36216,z=62513..76632
on x=-57137..-35534,y=26364..30930,z=47504..77090
on x=-41608..-18461,y=-42765..-18900,z=59370..81028
on x=-79954..-65176,y=-48791..-24716,z=-18848..6604
on x=-34241..-17350,y=-56143..-45006,z=44227..58857
on x=-5530..18391,y=42342..80378,z=44220..64341
on x=30538..43170,y=-48953..-12974,z=-64060..-46708
on x=18461..24438,y=-27505..-8539,z=-92027..-61631
on x=7320..30402,y=2065..30085,z=63426..78441
on x=-83260..-52652,y=-51533..-38598,z=-14357..16445
on x=-62617..-42138,y=42994..61052,z=-44270..-29008
on x=41132..55256,y=17301..44161,z=47335..72698
on x=-38586..-28967,y=15440..46541,z=54083..79262
on x=4995..13584,y=-83385..-58047,z=8179..45684
on x=-9417..16240,y=-364..29729,z=63018..79305
on x=-12093..-408,y=69909..76313,z=17279..43292
on x=22311..54594,y=-61374..-47340,z=38721..58551
on x=17514..41718,y=19397..55401,z=52361..75918
on x=-50215..-25999,y=-31832..-5898,z=-76682..-69666
on x=-88531..-51323,y=20056..51515,z=-25044..3011
on x=31693..42788,y=58122..73210,z=10170..25065
on x=-53730..-34736,y=-81115..-51623,z=-18858..-15751
on x=-8074..19450,y=56979..82537,z=21384..34758
on x=-9034..12679,y=-88632..-76023,z=-5255..10049
on x=-86158..-60722,y=-29277..-10774,z=-8108..5698
on x=51152..71206,y=-60178..-30734,z=-35299..-26419
on x=-53802..-21439,y=-81913..-62752,z=-48874..-14789
on x=-73416..-53624,y=-34880..-13729,z=-53059..-31384
on x=56542..90289,y=-39884..-24348,z=-33572..-10907
on x=6068..14850,y=-24184..-14322,z=60362..84796
on x=-65456..-62775,y=-39784..-18820,z=29946..43097
on x=-20508..-10931,y=21416..42909,z=-92770..-64543
on x=-78252..-45498,y=-42625..-36372,z=-37489..-22616
on x=-57749..-32551,y=33364..54148,z=39122..59239
on x=42486..64700,y=53697..67728,z=6295..16867
on x=-49857..-32057,y=8944..15961,z=66948..80602
on x=5331..24738,y=60035..81743,z=-9594..14754
on x=-37717..-27443,y=-26773..4070,z=-92232..-59205
on x=65813..86768,y=-40687..-15775,z=-29939..-15873
on x=3652..16387,y=-11856..10121,z=74824..93756
on x=-79835..-45711,y=-53126..-25959,z=-44777..-15785
on x=29228..52342,y=-42363..-18344,z=-83369..-51120
on x=-77918..-47225,y=-64364..-34769,z=-23149..-14421
on x=53783..76513,y=-54253..-24629,z=-1497..25601
on x=-4117..22514,y=-68600..-43788,z=39330..61783
on x=56356..73410,y=29059..61247,z=23522..30743
on x=-53663..-19354,y=9252..18430,z=55428..81436
on x=-77447..-54826,y=-13321..11273,z=37758..54142
on x=-33225..-11181,y=-88722..-71114,z=-17425..-1981
on x=34224..64644,y=-2807..21051,z=-76498..-56029
on x=-84451..-58720,y=-8709..7250,z=28349..41147
on x=32736..58563,y=-56724..-25395,z=38575..66087
on x=-70967..-60938,y=-14558..-1120,z=31180..57527
on x=57978..73770,y=37063..64257,z=-6069..-220
on x=20034..21990,y=-73943..-62810,z=16616..34791
on x=-86125..-62182,y=-46075..-37645,z=-22559..-16252
on x=64441..79235,y=44123..53922,z=-15543..5734
on x=58533..82768,y=-2754..6990,z=26452..35254
on x=34809..61230,y=-73095..-41773,z=16468..37593
on x=27000..39601,y=-35268..-18100,z=-72724..-54029
on x=-84967..-77387,y=-19101..-328,z=-9397..13132
on x=-19461..8572,y=13497..45738,z=-86131..-73254
on x=-86433..-60998,y=-56901..-29700,z=-18913..-2693
on x=-18094..5939,y=-84753..-47530,z=33605..55713
on x=-52752..-32887,y=-76293..-43540,z=20582..47775
on x=38804..57591,y=28533..48342,z=23227..52409
on x=-33372..-19183,y=60151..91114,z=-5895..13014
on x=8399..15500,y=-46061..-19393,z=-88136..-58963
on x=-70207..-50729,y=-27195..3250,z=49944..64484
on x=-83322..-60694,y=-4859..1403,z=-55073..-24265
on x=51507..67511,y=22011..37789,z=27870..58092
on x=2315..14851,y=70777..97981,z=-4391..22434
on x=63322..90550,y=13247..36385,z=-20220..2069
on x=-7013..25559,y=40439..56120,z=-72584..-61716
on x=-40699..-27549,y=4164..28551,z=53800..74409
on x=-51494..-24862,y=-80402..-64283,z=5411..14489
on x=-72139..-55806,y=7820..29650,z=25222..38356
on x=12742..29953,y=56665..75761,z=-11802..13027
on x=44039..72762,y=26530..56028,z=-42832..-10426
on x=-37796..-27142,y=-30810..-8406,z=-70974..-66926
on x=43717..56286,y=-26329..-1604,z=43116..72171
on x=19995..45643,y=-81477..-55528,z=-50320..-32192
on x=-49680..-28498,y=62214..65820,z=4605..27403
on x=59518..86037,y=25183..54580,z=-18246..17254
on x=-47268..-30247,y=57888..82990,z=-12900..3592
on x=-37656..-27114,y=-74361..-62506,z=-7732..28378
on x=5240..14690,y=72411..91552,z=-4756..19683
on x=-13372..17477,y=34586..56772,z=-82117..-63141
on x=-73452..-63296,y=-30094..-10448,z=22254..41160
on x=20735..26850,y=8049..29008,z=-87764..-67519
on x=-76309..-65638,y=1432..22127,z=24850..31614
on x=-56517..-42480,y=-29032..-8499,z=-76299..-46050
on x=-36653..-19363,y=11175..28415,z=66897..87189
on x=62824..67201,y=13766..38734,z=35946..42497
on x=-19952..-10429,y=74606..80317,z=-5904..9244
on x=63120..89695,y=-7158..10597,z=20219..31044
on x=-19027..-2451,y=60517..68949,z=33513..50296
on x=-26923..178,y=60741..97131,z=-20073..-10265
on x=-34849..-16047,y=-51895..-35335,z=-70945..-60177
on x=-41721..-28645,y=55366..79906,z=27747..32753
on x=-80144..-52339,y=-59029..-24157,z=-22364..-4544
on x=-4504..10906,y=32503..70662,z=46415..77796
on x=17183..29538,y=-18225..5416,z=66301..94405
on x=75285..86468,y=-9980..8717,z=20674..33762
on x=4311..28111,y=-83354..-62962,z=25674..42363
on x=-71564..-37032,y=-3279..4967,z=45245..76671
on x=-72811..-43922,y=36116..54013,z=-9748..23400
on x=-1220..17639,y=21306..41079,z=63317..81228
on x=37556..60204,y=-62343..-41856,z=10087..40031
on x=14130..31680,y=30041..49421,z=51511..76214
on x=-63039..-54227,y=-33537..-19281,z=34615..54260
on x=-91314..-63751,y=-3032..6841,z=-23321..2232
on x=-3127..19287,y=32794..47325,z=-76096..-49513
on x=-71132..-47802,y=4545..20375,z=48670..70063
on x=-61151..-40280,y=30652..36424,z=-62946..-37982
on x=14119..36433,y=-95152..-75989,z=6144..26828
on x=22834..51857,y=38327..58265,z=-65978..-49040
off x=66244..89751,y=-24261..7534,z=15888..42514
on x=-89728..-64157,y=-24044..4131,z=19969..28747
off x=-35080..-19430,y=56612..91727,z=8626..23420
off x=-47718..-31733,y=-43188..-28331,z=-67776..-45597
on x=-74294..-57200,y=-36792..-5040,z=-54121..-41055
off x=-24382..-20518,y=44282..50318,z=-68960..-42650
off x=-28521..-11994,y=-8661..4706,z=-88439..-56964
on x=52049..74171,y=-44537..-30138,z=-47237..-27418
on x=-1707..15178,y=34753..55182,z=-74195..-46652
off x=31059..42725,y=43145..70092,z=-38459..-30046
on x=40446..59879,y=-59586..-36260,z=-33512..-11076
off x=-79707..-50997,y=33225..51747,z=14860..47325
on x=-19465..-7616,y=10119..31262,z=-87813..-71548
on x=-83962..-64896,y=-20394..-7180,z=-61988..-32043
off x=57772..82725,y=-8053..15222,z=973..22968
off x=12596..37443,y=48270..79255,z=-49385..-33356
on x=-1003..8848,y=3538..36480,z=67569..78791
on x=-82583..-61600,y=-56407..-35035,z=-26389..-4025
off x=-441..23101,y=-65805..-48288,z=-52691..-32101
off x=60604..90029,y=-19348..-12737,z=-42042..-27174
off x=17436..39271,y=72348..90756,z=-25418..-8051
off x=26847..53845,y=46859..73289,z=23426..31266
off x=16841..27203,y=23421..55101,z=49100..83605
off x=25714..42561,y=-8143..13044,z=64035..91107
on x=29558..48710,y=-57841..-33714,z=33263..67264
off x=11715..35392,y=39866..51678,z=60099..69063
on x=23402..48483,y=37984..59658,z=48734..59709
on x=75216..93398,y=-37876..-11754,z=-1464..22273
off x=38528..43781,y=5542..42957,z=52809..77368
on x=72051..74887,y=-3880..3267,z=26293..34756
off x=-6816..4852,y=1566..29804,z=-80492..-65423
on x=49708..81155,y=32161..56409,z=-32648..-13317
on x=38909..68249,y=37014..67847,z=13517..42846
on x=-54894..-16193,y=-67206..-56964,z=-57382..-33779
on x=-81586..-61862,y=-24449..-420,z=-43066..-15910
on x=29328..40904,y=60475..81198,z=-31636..-14673
off x=-5756..14438,y=-80552..-71779,z=-14292..-6865
on x=-61722..-56718,y=23303..45126,z=-62045..-39044
off x=29463..53594,y=-69311..-47154,z=-65164..-43563
on x=-29305..-7147,y=-56581..-39066,z=-71283..-49802
off x=26856..50097,y=-61266..-31296,z=-66719..-39032
on x=46464..63140,y=-64133..-42261,z=-11759..5149
off x=-83817..-61709,y=-37291..-21874,z=-519..9751
off x=55841..74697,y=40336..59356,z=11147..34426
on x=34828..69659,y=-20348..-3038,z=-58724..-55121
off x=21197..38486,y=-72990..-45057,z=-53372..-35381
off x=-73182..-49019,y=28385..50982,z=-42019..-21521
off x=-76884..-61701,y=18507..39972,z=1310..29815
on x=55547..71247,y=4141..26473,z=-56178..-52622
on x=13772..43566,y=55179..85749,z=-13447..14016
on x=-55863..-32769,y=38694..59920,z=-33084..-7650
off x=-71553..-51565,y=-7760..1771,z=44677..67548
on x=15461..31815,y=-68075..-55208,z=33755..38037
off x=-757..36383,y=-21000..466,z=-82460..-62406
on x=31348..41123,y=-55197..-29777,z=42323..69200
off x=-5382..9760,y=-59558..-41324,z=-73937..-45324
on x=-6236..21866,y=-82614..-52320,z=33120..35911
off x=4099..31840,y=-71104..-64545,z=-49523..-23826
off x=29700..42212,y=48414..79717,z=13133..39395
on x=30163..49570,y=-32012..-6858,z=-82363..-58792
on x=-46359..-40371,y=-69671..-55358,z=6944..32266
off x=35348..60233,y=-59451..-46944,z=-50174..-21191
on x=-59278..-40919,y=48706..74528,z=-32748..-24764
on x=-57659..-37141,y=-74346..-56091,z=-17851..-3011
off x=-68343..-39351,y=-17836..3402,z=-70369..-50558
on x=-17324..10446,y=27985..43066,z=-84705..-64368
off x=-2280..7517,y=61082..89231,z=-19465..-2882
on x=5543..33886,y=77122..80758,z=-10232..26039
off x=19644..31561,y=42033..74969,z=45658..57072
on x=28283..49889,y=49674..76561,z=13613..37459
on x=45096..53724,y=18463..39530,z=38390..74144
off x=41400..61615,y=55595..76548,z=-25393..-1387
off x=16748..34122,y=29923..56425,z=-75021..-51740
on x=-15179..5656,y=-95572..-69068,z=11214..25476
off x=-58988..-47130,y=30229..46889,z=-44974..-35744
off x=-38977..-14492,y=-36334..-3133,z=-87758..-60247
off x=-67544..-49093,y=58841..65953,z=-34695..2783
on x=-44817..-12547,y=-69513..-42436,z=39463..67412
off x=-44782..-35211,y=63582..79211,z=-35165..-9576
off x=-51917..-19062,y=-70443..-39929,z=-56733..-29318
off x=-32721..-9720,y=-70269..-48267,z=39356..68334
on x=-89499..-64841,y=-7134..14311,z=10526..42888
off x=-15686..10883,y=-68334..-64832,z=40994..55889
off x=15665..28627,y=66455..83258,z=-19131..2585
on x=-36618..-12260,y=-1197..23827,z=-84792..-62643
on x=-63442..-42432,y=31128..47260,z=-58742..-50931
off x=59788..75917,y=-43859..-30744,z=-37530..-27877
on x=-97459..-75879,y=-2528..12488,z=-25702..8626
off x=4312..20664,y=43578..62639,z=45490..65994
off x=-42832..-21422,y=-36295..-10208,z=64453..78449
on x=45985..62219,y=41630..64002,z=-35004..-28441
off x=30577..58921,y=60165..62928,z=2996..24752
on x=-63410..-43768,y=18828..35057,z=-54580..-27363
on x=-37744..-7907,y=57733..80242,z=-9272..25957
off x=37094..69910,y=-11677..3264,z=57810..73004
off x=-58324..-35044,y=-65535..-55260,z=-14769..16228
on x=29859..52630,y=-10518..7762,z=-70264..-49235
on x=57003..84333,y=-43825..-36782,z=-2738..13139
on x=71783..92840,y=-12502..2933,z=-27092..1613
on x=40360..50398,y=-23637..-8074,z=-66669..-60640
on x=43892..72948,y=-1818..13786,z=-66670..-46862
off x=-77329..-51638,y=5621..37354,z=-38107..-25102
on x=-16374..13066,y=-43732..-18415,z=-82490..-64333
off x=-13344..-10566,y=-39722..-23766,z=-88355..-56712
on x=-1142..4694,y=56137..86923,z=-53607..-22509
off x=-57266..-32196,y=3936..11070,z=66725..88936
on x=46021..63903,y=35240..49664,z=15607..37579
on x=57444..70046,y=3467..37797,z=41207..53935
on x=-70116..-53894,y=34009..53610,z=5772..25407
on x=1370..17649,y=-45129..-26001,z=-71085..-60208
on x=27244..51676,y=16417..41941,z=50284..75127
off x=-7215..16100,y=13132..33300,z=52638..88374
on x=-67708..-56526,y=28446..49266,z=-54764..-36982
off x=36565..53117,y=-69659..-48686,z=-56660..-30523
on x=-34438..-14244,y=-45433..-35154,z=-66685..-45700
off x=-91754..-62736,y=6030..27794,z=-36516..-23095
on x=-20638..-13653,y=-9532..17224,z=63461..84278
on x=-59626..-50588,y=-32678..-6316,z=46959..59720
off x=-20225..749,y=-69753..-43037,z=-70716..-40645
off x=-56667..-40496,y=11366..43347,z=46773..65399
off x=-58207..-36567,y=42530..65883,z=-24484..-7023
off x=-34762..-20011,y=42739..59302,z=-49523..-35094
on x=-61220..-42210,y=-66752..-48262,z=8014..23734
off x=-49232..-41437,y=-63307..-37354,z=24865..47979
on x=26703..52532,y=-78499..-46465,z=-25018..-8738
off x=21105..43246,y=38644..70375,z=42805..60720
on x=-29375..-9597,y=-86639..-63948,z=-642..25463
on x=56583..64693,y=22117..52883,z=-40318..-24339
on x=-35643..-27958,y=47024..56238,z=36245..52842
off x=-33039..-14225,y=64997..87100,z=-41179..-4967
off x=59162..83173,y=25323..44364,z=2725..23248
off x=52877..68876,y=-45091..-16834,z=-42624..-16917
on x=38829..70185,y=8104..18659,z=45852..67774
off x=-27424..-2771,y=-93872..-68133,z=-3046..23499
off x=39387..48068,y=-14087..2670,z=-70270..-50908
off x=-67568..-31653,y=-63342..-45027,z=-44056..-28022
off x=73339..75776,y=19469..34170,z=9060..24104
on x=18259..51005,y=48630..76031,z=7479..26749
on x=14513..37579,y=-33597..-15184,z=63582..76318
on x=-41275..-31697,y=-24246..-37,z=57091..73485
off x=-31890..-16118,y=-76794..-49970,z=29480..57799
on x=71419..87971,y=15207..25964,z=-19283..7832
on x=-41791..-24849,y=59031..75550,z=-18258..9027
on x=-38199..-24871,y=42794..71254,z=-42870..-21798
on x=-25039..-8806,y=-76747..-56020,z=-57258..-29947
off x=-22405..10912,y=-55580..-41017,z=-75320..-53817
on x=-49793..-22756,y=-27786..-9284,z=58862..86007
off x=25510..36784,y=-35757..-20885,z=-75794..-46116
on x=-3712..14342,y=65221..88505,z=-9736..11415
off x=-17899..7630,y=-87586..-63559,z=-18626..2791
off x=-14610..11209,y=24694..36426,z=-89209..-72203
on x=-41903..-27211,y=-37226..-32667,z=-61406..-49458
on x=-29172..-15874,y=-29621..8729,z=-94236..-66936
off x=-7596..-2397,y=-24666..-3179,z=68145..98782
off x=-30179..-17490,y=-26796..7612,z=-78764..-61938
off x=-50707..-22641,y=-62067..-42787,z=-61450..-36116
on x=-2926..22736,y=-56652..-31989,z=54504..85199
on x=-12251..16818,y=-45483..-39539,z=-85412..-54335
off x=-30871..-10215,y=25326..41186,z=65924..74927
off x=-27548..-2218,y=-90837..-53885,z=24861..40128
off x=-15719..-8624,y=-24279..7866,z=-78569..-62304
on x=5300..29443,y=-60482..-32603,z=53463..77364
off x=-36883..-4698,y=-11779..15251,z=-85176..-63993
off x=77136..95419,y=-991..22518,z=-30101..-5527
off x=-77467..-49063,y=-3059..21180,z=-69555..-36161
off x=43217..54077,y=56300..68390,z=-17902..7166
off x=-27450..-5699,y=-85434..-62891,z=12577..21069
on x=-34456..-17300,y=-38896..-25828,z=-88087..-66157
off x=-6542..22866,y=48683..62179,z=51476..66042
off x=-85081..-63427,y=24901..39908,z=-22256..-2736
on x=-84263..-51335,y=-43993..-23210,z=-50786..-14571
off x=70496..91875,y=-99..13516,z=-15338..-1176
on x=-3414..20761,y=-58271..-50023,z=-70568..-58707
on x=-37366..-24760,y=-40714..-28220,z=-68669..-57693
on x=55366..69711,y=19336..39334,z=41575..56327
off x=7756..37863,y=6813..30407,z=-86788..-58086
on x=64340..71944,y=-58382..-21540,z=-26270..-7157
off x=-66006..-47470,y=-36577..-20368,z=19166..34254
on x=-58240..-46662,y=-3017..27043,z=55289..74468
off x=-39417..-32733,y=-29342..-7099,z=-79724..-67801
on x=-79339..-46658,y=-7270..19942,z=-50655..-39180
off x=-60143..-38745,y=-19956..11524,z=-84176..-55543
off x=-3874..10037,y=-64263..-39967,z=-74772..-50336
on x=-11752..2774,y=-57741..-44508,z=51849..72929
on x=-11710..-4855,y=-72067..-49425,z=-62392..-47771
off x=43931..74857,y=41059..57790,z=-36316..-17211
off x=3946..34651,y=-53908..-25012,z=52699..70802
off x=-46656..-15008,y=17844..47261,z=55932..84912
off x=26684..42064,y=56114..63695,z=14465..39503
on x=-40489..-22313,y=8243..32746,z=-74516..-48795
off x=-22851..-6555,y=-82055..-68517,z=-28862..-6378
off x=-74113..-54822,y=24351..54331,z=7776..25070
off x=-45651..-16942,y=18572..51284,z=62915..80308
on x=-70429..-46638,y=-63316..-43477,z=-9658..15603
on x=10379..47780,y=72033..88868,z=-19821..-11434
on x=-22601..1937,y=4579..19393,z=-80796..-60988
on x=54161..77065,y=-58754..-49409,z=338..31784
on x=28966..60740,y=50370..68031,z=8613..32275

A 2021/22/input2 => 2021/22/input2 +4 -0
@@ 0,0 1,4 @@
on 10..12,10..12,10..12
on 11..13,11..13,11..13
off 9..11,9..11,9..11
on 10..10,10..10,10..10

A 2021/22/input3 => 2021/22/input3 +60 -0
@@ 0,0 1,60 @@
on -5..47,-31..22,-19..33
on -44..5,-27..21,-14..35
on -49..-1,-11..42,-10..38
on -20..34,-40..6,-44..1
off 26..39,40..50,-2..11
on -41..5,-41..6,-36..8
off -43..-33,-45..-28,7..25
on -33..15,-32..19,-34..11
off 35..47,-46..-34,-11..5
on -14..36,-6..44,-16..29
on -57795..-6158,29564..72030,20435..90618
on 36731..105352,-21140..28532,16094..90401
on 30999..107136,-53464..15513,8553..71215
on 13528..83982,-99403..-27377,-24141..23996
on -72682..-12347,18159..111354,7391..80950
on -1060..80757,-65301..-20884,-103788..-16709
on -83015..-9461,-72160..-8347,-81239..-26856
on -52752..22273,-49450..9096,54442..119054
on -29982..40483,-108474..-28371,-24328..38471
on -4958..62750,40422..118853,-7672..65583
on 55694..108686,-43367..46958,-26781..48729
on -98497..-18186,-63569..3412,1232..88485
on -726..56291,-62629..13224,18033..85226
on -110886..-34664,-81338..-8658,8914..63723
on -55829..24974,-16897..54165,-121762..-28058
on -65152..-11147,22489..91432,-58782..1780
on -120100..-32970,-46592..27473,-11695..61039
on -18631..37533,-124565..-50804,-35667..28308
on -57817..18248,49321..117703,5745..55881
on 14781..98692,-1341..70827,15753..70151
on -34419..55919,-19626..40991,39015..114138
on -60785..11593,-56135..2999,-95368..-26915
on -32178..58085,17647..101866,-91405..-8878
on -53655..12091,50097..105568,-75335..-4862
on -111166..-40997,-71714..2688,5609..50954
on -16602..70118,-98693..-44401,5197..76897
on 16383..101554,4615..83635,-44907..18747
off -95822..-15171,-19987..48940,10804..104439
on -89813..-14614,16069..88491,-3297..45228
on 41075..99376,-20427..49978,-52012..13762
on -21330..50085,-17944..62733,-112280..-30197
on -16478..35915,36008..118594,-7885..47086
off -98156..-27851,-49952..43171,-99005..-8456
off 2032..69770,-71013..4824,7471..94418
on 43670..120875,-42068..12382,-24787..38892
off 37514..111226,-45862..25743,-16714..54663
off 25699..97951,-30668..59918,-15349..69697
off -44271..17935,-9516..60759,49131..112598
on -61695..-5813,40978..94975,8655..80240
off -101086..-9439,-7088..67543,33935..83858
off 18020..114017,-48931..32606,21474..89843
off -77139..10506,-89994..-18797,-80..59318
off 8476..79288,-75520..11602,-96624..-24783
on -47488..-1262,24338..100707,16292..72967
off -84341..13987,2429..92914,-90671..-1318
off -37810..49457,-71013..-7894,-105357..-13188
off -27365..46395,31009..98017,15428..76570
off -70369..-16548,22648..78696,-1892..86821
on -53470..21291,-120233..-33476,-44150..38147
off -93533..-4276,-16170..68771,-104985..-24507

A 2021/22/input4 => 2021/22/input4 +22 -0
@@ 0,0 1,22 @@
on -20..26,-36..17,-47..7
on -20..33,-21..23,-26..28
on -22..28,-29..23,-38..16
on -46..7,-6..46,-50..-1
on -49..1,-3..46,-24..28
on 2..47,-22..22,-23..27
on -27..23,-28..26,-21..29
on -39..5,-6..47,-3..44
on -30..21,-8..43,-13..34
on -22..26,-27..20,-29..19
off -48..-32,26..41,-47..-37
on -12..35,6..50,-50..-2
off -48..-32,-32..-16,-15..-5
on -18..26,-33..15,-7..46
off -40..-22,-38..-28,23..41
on -16..35,-41..10,-47..6
off -32..-23,11..30,-14..3
on -49..-5,-3..45,-29..18
off 18..30,-20..-8,-3..13
on -41..9,-7..43,-33..15
on -54112..-39298,-85059..-49293,-27449..7877
on 967..23432,45373..81175,27513..53682

A 2021/22/one => 2021/22/one +2 -0
@@ 0,0 1,2 @@
on 0..2,0..2,0..2
off 1..1,1..1,1..1

A 2021/22/realinput => 2021/22/realinput +420 -0
@@ 0,0 1,420 @@
on -3..43,-22..22,-15..34
on -9..42,-40..12,-30..19
on -5..46,-9..38,-31..21
on -27..25,-30..22,-9..42
on -25..27,-43..3,-22..31
on -39..9,-45..8,-17..29
on -10..36,-2..44,-9..35
on -45..4,-41..5,-3..49
on -24..26,-34..12,-6..44
on -35..17,-36..11,-42..10
off 5..19,6..21,-21..-3
on -45..1,-40..11,-31..20
off 16..30,-16..-4,21..33
on -38..7,-30..15,-46..3
off 36..48,-39..-22,-47..-34
on -23..22,-22..29,-27..24
off -39..-29,-47..-34,-13..-1
on -18..28,-3..44,-8..38
off -38..-24,-48..-39,14..28
on -32..21,-36..9,-38..16
on -40114..-18236,44675..56621,-62989..-35133
on -47063..-26565,34232..54684,-70517..-34320
on -56151..-43929,48563..58124,36908..41850
on -77794..-42408,-69580..-49841,1311..11416
on -55821..-38492,49499..69556,17469..29122
on 63143..77824,-46210..-33353,9878..30392
on 39342..53117,-50110..-40820,-62170..-40938
on -73484..-48152,-65736..-42700,-18262..-13156
on 37366..54383,19405..43152,47195..68515
on -58204..-27378,-43155..-25521,-62841..-54391
on -74420..-47151,37359..62719,-25475..-3046
on -45598..-17555,-26089..-5704,-70074..-64019
on -60861..-28014,-73554..-54991,-31524..-9823
on -24856..-677,-30123..-15884,63853..91090
on -70612..-48898,-58794..-27838,31988..51431
on -39272..-20927,-20393..-13252,-85528..-72953
on -25668..-4103,-18215..-1734,-91736..-74972
on -58040..-34891,-68034..-41896,22484..48325
on -83077..-63382,17005..35646,-28949..3129
on -75533..-63223,-47132..-32953,18181..35552
on -12005..9792,19338..25243,-92843..-67825
on 56387..84965,-35767..-23866,-7517..29845
on 41294..42717,62107..77449,-6076..18165
on 68909..88527,12129..33752,-14973..1514
on 70106..89265,-44616..-27968,-11036..-1697
on 23822..38056,40195..55684,-65662..-33478
on 57501..81938,-18907..-5701,5821..28274
on -25260..-17668,-48592..-46210,-69961..-51155
on -40924..-23866,59810..71028,1641..21630
on 34547..43160,-74622..-56131,-36907..-17782
on -21350..276,14485..29856,-77890..-58230
on -75736..-39641,-2847..32980,-57010..-42061
on -25041..-10364,-77922..-57550,18525..31966
on -11867..7378,17836..49462,-90609..-54269
on -73484..-39680,-39303..-21793,31847..54382
on -16778..-10708,-66044..-52096,-44957..-39847
on -6352..5197,-48264..-42773,-69346..-65566
on -70366..-51952,-45555..-37939,-60527..-28534
on 21301..42400,-20291..4389,66067..89444
on 45669..82341,-56204..-41535,-21028..-14812
on -12687..6121,-75650..-50731,40334..49677
on 62454..72648,-56206..-23070,-36904..-4173
on -14045..15260,74607..78556,3616..39536
on 3027..21243,58402..67345,32845..51345
on 36180..53611,3808..31420,-75144..-41742
on 62333..81915,22152..45857,-19764..3026
on 16840..31474,51862..63491,41052..56975
on 34291..46927,-64612..-48527,-43496..-32299
on -15540..7128,28606..58975,61419..80612
on -41973..-18320,-77313..-61240,15692..47003
on -53801..-30362,39541..57030,-60083..-35312
on 68377..77233,20169..50880,-27441..-20458
on -48517..-32670,27681..29643,43402..61515
on -27916..-4199,26661..49908,52384..82183
on 49989..60432,-53633..-30668,-41268..-22103
on 27313..55472,56100..75902,19430..45734
on -6356..15818,-68706..-57263,36276..50109
on -86603..-47010,-10414..18891,-47053..-29175
on -55452..-23629,-70516..-54860,1793..24906
on 50625..72911,-12487..-2707,-71603..-40651
on 39137..55253,19930..23696,45922..65211
on -9884..16104,-37553..-13090,-80288..-61586
on 15247..32364,58299..77121,12794..38315
on -66919..-64795,27710..52508,-5853..20204
on 55575..68137,-44413..-25743,-53783..-25185
on -28440..950,-58170..-37455,42708..66553
on -62883..-47411,41864..58827,-14578..6700
on -77452..-58620,-27879..-12335,28389..50389
on 16287..41670,-20720..-3731,58921..81851
on -39948..-11682,62858..90995,-33475..-6506
on -56395..-35664,27367..43557,-61199..-44459
on -52933..-35603,-11996..5380,-73054..-57610
on -13683..-926,-79150..-68241,13231..23670
on -2283..11495,-47635..-35881,65101..72052
on 68775..80912,-16331..4168,9807..29318
on -82722..-62858,28101..48460,-20008..-10603
on 2241..10548,76361..96934,-22674..-2056
on 54720..67218,-55890..-27903,-24408..-4708
on -29992..1612,7330..30747,-89965..-57543
on -26063..-23251,-14766..-5848,56200..88720
on 25688..45780,48319..64535,29487..42809
on -10623..723,21921..25266,59433..79964
on 9630..28513,-55849..-40790,59817..71724
on 11397..35361,-80067..-68146,-50677..-32416
on 50224..86037,-20267..-15219,-58574..-37744
on -46674..-23145,25112..36216,62513..76632
on -57137..-35534,26364..30930,47504..77090
on -41608..-18461,-42765..-18900,59370..81028
on -79954..-65176,-48791..-24716,-18848..6604
on -34241..-17350,-56143..-45006,44227..58857
on -5530..18391,42342..80378,44220..64341
on 30538..43170,-48953..-12974,-64060..-46708
on 18461..24438,-27505..-8539,-92027..-61631
on 7320..30402,2065..30085,63426..78441
on -83260..-52652,-51533..-38598,-14357..16445
on -62617..-42138,42994..61052,-44270..-29008
on 41132..55256,17301..44161,47335..72698
on -38586..-28967,15440..46541,54083..79262
on 4995..13584,-83385..-58047,8179..45684
on -9417..16240,-364..29729,63018..79305
on -12093..-408,69909..76313,17279..43292
on 22311..54594,-61374..-47340,38721..58551
on 17514..41718,19397..55401,52361..75918
on -50215..-25999,-31832..-5898,-76682..-69666
on -88531..-51323,20056..51515,-25044..3011
on 31693..42788,58122..73210,10170..25065
on -53730..-34736,-81115..-51623,-18858..-15751
on -8074..19450,56979..82537,21384..34758
on -9034..12679,-88632..-76023,-5255..10049
on -86158..-60722,-29277..-10774,-8108..5698
on 51152..71206,-60178..-30734,-35299..-26419
on -53802..-21439,-81913..-62752,-48874..-14789
on -73416..-53624,-34880..-13729,-53059..-31384
on 56542..90289,-39884..-24348,-33572..-10907
on 6068..14850,-24184..-14322,60362..84796
on -65456..-62775,-39784..-18820,29946..43097
on -20508..-10931,21416..42909,-92770..-64543
on -78252..-45498,-42625..-36372,-37489..-22616
on -57749..-32551,33364..54148,39122..59239
on 42486..64700,53697..67728,6295..16867
on -49857..-32057,8944..15961,66948..80602
on 5331..24738,60035..81743,-9594..14754
on -37717..-27443,-26773..4070,-92232..-59205
on 65813..86768,-40687..-15775,-29939..-15873
on 3652..16387,-11856..10121,74824..93756
on -79835..-45711,-53126..-25959,-44777..-15785
on 29228..52342,-42363..-18344,-83369..-51120
on -77918..-47225,-64364..-34769,-23149..-14421
on 53783..76513,-54253..-24629,-1497..25601
on -4117..22514,-68600..-43788,39330..61783
on 56356..73410,29059..61247,23522..30743
on -53663..-19354,9252..18430,55428..81436
on -77447..-54826,-13321..11273,37758..54142
on -33225..-11181,-88722..-71114,-17425..-1981
on 34224..64644,-2807..21051,-76498..-56029
on -84451..-58720,-8709..7250,28349..41147
on 32736..58563,-56724..-25395,38575..66087
on -70967..-60938,-14558..-1120,31180..57527
on 57978..73770,37063..64257,-6069..-220
on 20034..21990,-73943..-62810,16616..34791
on -86125..-62182,-46075..-37645,-22559..-16252
on 64441..79235,44123..53922,-15543..5734
on 58533..82768,-2754..6990,26452..35254
on 34809..61230,-73095..-41773,16468..37593
on 27000..39601,-35268..-18100,-72724..-54029
on -84967..-77387,-19101..-328,-9397..13132
on -19461..8572,13497..45738,-86131..-73254
on -86433..-60998,-56901..-29700,-18913..-2693
on -18094..5939,-84753..-47530,33605..55713
on -52752..-32887,-76293..-43540,20582..47775
on 38804..57591,28533..48342,23227..52409
on -33372..-19183,60151..91114,-5895..13014
on 8399..15500,-46061..-19393,-88136..-58963
on -70207..-50729,-27195..3250,49944..64484
on -83322..-60694,-4859..1403,-55073..-24265
on 51507..67511,22011..37789,27870..58092
on 2315..14851,70777..97981,-4391..22434
on 63322..90550,13247..36385,-20220..2069
on -7013..25559,40439..56120,-72584..-61716
on -40699..-27549,4164..28551,53800..74409
on -51494..-24862,-80402..-64283,5411..14489
on -72139..-55806,7820..29650,25222..38356
on 12742..29953,56665..75761,-11802..13027
on 44039..72762,26530..56028,-42832..-10426
on -37796..-27142,-30810..-8406,-70974..-66926
on 43717..56286,-26329..-1604,43116..72171
on 19995..45643,-81477..-55528,-50320..-32192
on -49680..-28498,62214..65820,4605..27403
on 59518..86037,25183..54580,-18246..17254
on -47268..-30247,57888..82990,-12900..3592
on -37656..-27114,-74361..-62506,-7732..28378
on 5240..14690,72411..91552,-4756..19683
on -13372..17477,34586..56772,-82117..-63141
on -73452..-63296,-30094..-10448,22254..41160
on 20735..26850,8049..29008,-87764..-67519
on -76309..-65638,1432..22127,24850..31614
on -56517..-42480,-29032..-8499,-76299..-46050
on -36653..-19363,11175..28415,66897..87189
on 62824..67201,13766..38734,35946..42497
on -19952..-10429,74606..80317,-5904..9244
on 63120..89695,-7158..10597,20219..31044
on -19027..-2451,60517..68949,33513..50296
on -26923..178,60741..97131,-20073..-10265
on -34849..-16047,-51895..-35335,-70945..-60177
on -41721..-28645,55366..79906,27747..32753
on -80144..-52339,-59029..-24157,-22364..-4544
on -4504..10906,32503..70662,46415..77796
on 17183..29538,-18225..5416,66301..94405
on 75285..86468,-9980..8717,20674..33762
on 4311..28111,-83354..-62962,25674..42363
on -71564..-37032,-3279..4967,45245..76671
on -72811..-43922,36116..54013,-9748..23400
on -1220..17639,21306..41079,63317..81228
on 37556..60204,-62343..-41856,10087..40031
on 14130..31680,30041..49421,51511..76214
on -63039..-54227,-33537..-19281,34615..54260
on -91314..-63751,-3032..6841,-23321..2232
on -3127..19287,32794..47325,-76096..-49513
on -71132..-47802,4545..20375,48670..70063
on -61151..-40280,30652..36424,-62946..-37982
on 14119..36433,-95152..-75989,6144..26828
on 22834..51857,38327..58265,-65978..-49040
off 66244..89751,-24261..7534,15888..42514
on -89728..-64157,-24044..4131,19969..28747
off -35080..-19430,56612..91727,8626..23420
off -47718..-31733,-43188..-28331,-67776..-45597
on -74294..-57200,-36792..-5040,-54121..-41055
off -24382..-20518,44282..50318,-68960..-42650
off -28521..-11994,-8661..4706,-88439..-56964
on 52049..74171,-44537..-30138,-47237..-27418
on -1707..15178,34753..55182,-74195..-46652
off 31059..42725,43145..70092,-38459..-30046
on 40446..59879,-59586..-36260,-33512..-11076
off -79707..-50997,33225..51747,14860..47325
on -19465..-7616,10119..31262,-87813..-71548
on -83962..-64896,-20394..-7180,-61988..-32043
off 57772..82725,-8053..15222,973..22968
off 12596..37443,48270..79255,-49385..-33356
on -1003..8848,3538..36480,67569..78791
on -82583..-61600,-56407..-35035,-26389..-4025
off -441..23101,-65805..-48288,-52691..-32101
off 60604..90029,-19348..-12737,-42042..-27174
off 17436..39271,72348..90756,-25418..-8051
off 26847..53845,46859..73289,23426..31266
off 16841..27203,23421..55101,49100..83605
off 25714..42561,-8143..13044,64035..91107
on 29558..48710,-57841..-33714,33263..67264
off 11715..35392,39866..51678,60099..69063
on 23402..48483,37984..59658,48734..59709
on 75216..93398,-37876..-11754,-1464..22273
off 38528..43781,5542..42957,52809..77368
on 72051..74887,-3880..3267,26293..34756
off -6816..4852,1566..29804,-80492..-65423
on 49708..81155,32161..56409,-32648..-13317
on 38909..68249,37014..67847,13517..42846
on -54894..-16193,-67206..-56964,-57382..-33779
on -81586..-61862,-24449..-420,-43066..-15910
on 29328..40904,60475..81198,-31636..-14673
off -5756..14438,-80552..-71779,-14292..-6865
on -61722..-56718,23303..45126,-62045..-39044
off 29463..53594,-69311..-47154,-65164..-43563
on -29305..-7147,-56581..-39066,-71283..-49802
off 26856..50097,-61266..-31296,-66719..-39032
on 46464..63140,-64133..-42261,-11759..5149
off -83817..-61709,-37291..-21874,-519..9751
off 55841..74697,40336..59356,11147..34426
on 34828..69659,-20348..-3038,-58724..-55121
off 21197..38486,-72990..-45057,-53372..-35381
off -73182..-49019,28385..50982,-42019..-21521
off -76884..-61701,18507..39972,1310..29815
on 55547..71247,4141..26473,-56178..-52622
on 13772..43566,55179..85749,-13447..14016
on -55863..-32769,38694..59920,-33084..-7650
off -71553..-51565,-7760..1771,44677..67548
on 15461..31815,-68075..-55208,33755..38037
off -757..36383,-21000..466,-82460..-62406
on 31348..41123,-55197..-29777,42323..69200
off -5382..9760,-59558..-41324,-73937..-45324
on -6236..21866,-82614..-52320,33120..35911
off 4099..31840,-71104..-64545,-49523..-23826
off 29700..42212,48414..79717,13133..39395
on 30163..49570,-32012..-6858,-82363..-58792
on -46359..-40371,-69671..-55358,6944..32266
off 35348..60233,-59451..-46944,-50174..-21191
on -59278..-40919,48706..74528,-32748..-24764
on -57659..-37141,-74346..-56091,-17851..-3011
off -68343..-39351,-17836..3402,-70369..-50558
on -17324..10446,27985..43066,-84705..-64368
off -2280..7517,61082..89231,-19465..-2882
on 5543..33886,77122..80758,-10232..26039
off 19644..31561,42033..74969,45658..57072
on 28283..49889,49674..76561,13613..37459
on 45096..53724,18463..39530,38390..74144
off 41400..61615,55595..76548,-25393..-1387
off 16748..34122,29923..56425,-75021..-51740
on -15179..5656,-95572..-69068,11214..25476
off -58988..-47130,30229..46889,-44974..-35744
off -38977..-14492,-36334..-3133,-87758..-60247
off -67544..-49093,58841..65953,-34695..2783
on -44817..-12547,-69513..-42436,39463..67412
off -44782..-35211,63582..79211,-35165..-9576
off -51917..-19062,-70443..-39929,-56733..-29318
off -32721..-9720,-70269..-48267,39356..68334
on -89499..-64841,-7134..14311,10526..42888
off -15686..10883,-68334..-64832,40994..55889
off 15665..28627,66455..83258,-19131..2585
on -36618..-12260,-1197..23827,-84792..-62643
on -63442..-42432,31128..47260,-58742..-50931
off 59788..75917,-43859..-30744,-37530..-27877
on -97459..-75879,-2528..12488,-25702..8626
off 4312..20664,43578..62639,45490..65994
off -42832..-21422,-36295..-10208,64453..78449
on 45985..62219,41630..64002,-35004..-28441
off 30577..58921,60165..62928,2996..24752
on -63410..-43768,18828..35057,-54580..-27363
on -37744..-7907,57733..80242,-9272..25957
off 37094..69910,-11677..3264,57810..73004
off -58324..-35044,-65535..-55260,-14769..16228
on 29859..52630,-10518..7762,-70264..-49235
on 57003..84333,-43825..-36782,-2738..13139
on 71783..92840,-12502..2933,-27092..1613
on 40360..50398,-23637..-8074,-66669..-60640
on 43892..72948,-1818..13786,-66670..-46862
off -77329..-51638,5621..37354,-38107..-25102
on -16374..13066,-43732..-18415,-82490..-64333
off -13344..-10566,-39722..-23766,-88355..-56712
on -1142..4694,56137..86923,-53607..-22509
off -57266..-32196,3936..11070,66725..88936
on 46021..63903,35240..49664,15607..37579
on 57444..70046,3467..37797,41207..53935
on -70116..-53894,34009..53610,5772..25407
on 1370..17649,-45129..-26001,-71085..-60208
on 27244..51676,16417..41941,50284..75127
off -7215..16100,13132..33300,52638..88374
on -67708..-56526,28446..49266,-54764..-36982
off 36565..53117,-69659..-48686,-56660..-30523
on -34438..-14244,-45433..-35154,-66685..-45700
off -91754..-62736,6030..27794,-36516..-23095
on -20638..-13653,-9532..17224,63461..84278
on -59626..-50588,-32678..-6316,46959..59720
off -20225..749,-69753..-43037,-70716..-40645
off -56667..-40496,11366..43347,46773..65399
off -58207..-36567,42530..65883,-24484..-7023
off -34762..-20011,42739..59302,-49523..-35094
on -61220..-42210,-66752..-48262,8014..23734
off -49232..-41437,-63307..-37354,24865..47979
on 26703..52532,-78499..-46465,-25018..-8738
off 21105..43246,38644..70375,42805..60720
on -29375..-9597,-86639..-63948,-642..25463
on 56583..64693,22117..52883,-40318..-24339
on -35643..-27958,47024..56238,36245..52842
off -33039..-14225,64997..87100,-41179..-4967
off 59162..83173,25323..44364,2725..23248
off 52877..68876,-45091..-16834,-42624..-16917
on 38829..70185,8104..18659,45852..67774
off -27424..-2771,-93872..-68133,-3046..23499
off 39387..48068,-14087..2670,-70270..-50908
off -67568..-31653,-63342..-45027,-44056..-28022
off 73339..75776,19469..34170,9060..24104
on 18259..51005,48630..76031,7479..26749
on 14513..37579,-33597..-15184,63582..76318
on -41275..-31697,-24246..-37,57091..73485
off -31890..-16118,-76794..-49970,29480..57799
on 71419..87971,15207..25964,-19283..7832
on -41791..-24849,59031..75550,-18258..9027
on -38199..-24871,42794..71254,-42870..-21798
on -25039..-8806,-76747..-56020,-57258..-29947
off -22405..10912,-55580..-41017,-75320..-53817
on -49793..-22756,-27786..-9284,58862..86007
off 25510..36784,-35757..-20885,-75794..-46116
on -3712..14342,65221..88505,-9736..11415
off -17899..7630,-87586..-63559,-18626..2791
off -14610..11209,24694..36426,-89209..-72203
on -41903..-27211,-37226..-32667,-61406..-49458
on -29172..-15874,-29621..8729,-94236..-66936
off -7596..-2397,-24666..-3179,68145..98782
off -30179..-17490,-26796..7612,-78764..-61938
off -50707..-22641,-62067..-42787,-61450..-36116
on -2926..22736,-56652..-31989,54504..85199
on -12251..16818,-45483..-39539,-85412..-54335
off -30871..-10215,25326..41186,65924..74927
off -27548..-2218,-90837..-53885,24861..40128
off -15719..-8624,-24279..7866,-78569..-62304
on 5300..29443,-60482..-32603,53463..77364
off -36883..-4698,-11779..15251,-85176..-63993
off 77136..95419,-991..22518,-30101..-5527
off -77467..-49063,-3059..21180,-69555..-36161
off 43217..54077,56300..68390,-17902..7166
off -27450..-5699,-85434..-62891,12577..21069
on -34456..-17300,-38896..-25828,-88087..-66157
off -6542..22866,48683..62179,51476..66042
off -85081..-63427,24901..39908,-22256..-2736
on -84263..-51335,-43993..-23210,-50786..-14571
off 70496..91875,-99..13516,-15338..-1176
on -3414..20761,-58271..-50023,-70568..-58707
on -37366..-24760,-40714..-28220,-68669..-57693
on 55366..69711,19336..39334,41575..56327
off 7756..37863,6813..30407,-86788..-58086
on 64340..71944,-58382..-21540,-26270..-7157
off -66006..-47470,-36577..-20368,19166..34254
on -58240..-46662,-3017..27043,55289..74468
off -39417..-32733,-29342..-7099,-79724..-67801
on -79339..-46658,-7270..19942,-50655..-39180
off -60143..-38745,-19956..11524,-84176..-55543
off -3874..10037,-64263..-39967,-74772..-50336
on -11752..2774,-57741..-44508,51849..72929
on -11710..-4855,-72067..-49425,-62392..-47771
off 43931..74857,41059..57790,-36316..-17211
off 3946..34651,-53908..-25012,52699..70802
off -46656..-15008,17844..47261,55932..84912
off 26684..42064,56114..63695,14465..39503
on -40489..-22313,8243..32746,-74516..-48795
off -22851..-6555,-82055..-68517,-28862..-6378
off -74113..-54822,24351..54331,7776..25070
off -45651..-16942,18572..51284,62915..80308
on -70429..-46638,-63316..-43477,-9658..15603
on 10379..47780,72033..88868,-19821..-11434
on -22601..1937,4579..19393,-80796..-60988
on 54161..77065,-58754..-49409,338..31784
on 28966..60740,50370..68031,8613..32275

A 2021/22/simple => 2021/22/simple +2 -0
@@ 0,0 1,2 @@
on 0..8,0..8,0..8
off 3..5,3..5,3..5

A 2021/22/solution.go => 2021/22/solution.go +324 -0
@@ 0,0 1,324 @@
package main

import (
	"bufio"
	"fmt"
	// "math"
	"os"
	// "sort"
	"strconv"
	"strings"
	// "unicode"
)

func get_input() []string {
	input_file := ""
	if len(os.Args) >= 2 {
		input_file = os.Args[1]
	} else {
		input_file = "input"
	}
	file, err := os.Open(input_file)
	if err != nil {
		panic(err)
	}
	defer file.Close()

	strs := make([]string, 0)
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		value := scanner.Text()
		if err != nil {
			panic(err)
		}
		strs = append(strs, value)
	}
	if err :=scanner.Err(); err != nil {
		panic(err)
	}
	return strs
}

type Step struct {
	on bool
	coords [][]int // var, bottom/top
	small bool
}

type Pos struct {
	x int
	y int
	z int
}

type Shape struct {
	start Pos
	end Pos
	volume int
}

func main() {
	strs := get_input()

	steps := make([]Step, 0)
	for _, str := range strs {
		var step Step
		step.small = true
		step.coords = make([][]int, 3)
		split := strings.Split(str, " ")
		if split[0] == "on" {
			step.on = true
		} else {
			step.on = false
		}

		split = strings.Split(split[1], ",")
		for i, val := range split {
			coord := strings.Split(val, "..")
			val1, _ := strconv.Atoi(coord[0])
			val2, _ := strconv.Atoi(coord[1])
			step.coords[i] = []int{
				val1,
				val2,
			}
			if val1 < -50 || val2 > 50 {
				step.small = false
			}
		}
		steps = append(steps, step)
	}

	/* part 1
	cubes := make(map[Pos]bool)

	for _, step := range steps {
		if !step.small {
			continue
		}
		for x := step.coords[0][0]; x <= step.coords[0][1]; x++ {
			for y := step.coords[1][0]; y <= step.coords[1][1]; y++ {
				for z := step.coords[2][0]; z <= step.coords[2][1]; z++ {
					cubes[Pos{x,y,z}] = step.on
				}
			}
		}
	}

	on := 0
	for _, v := range cubes {
		if v {
			on++
		}
	}
	fmt.Println(on)
	*/

	shapes := make(map[Shape]bool)

	for _, step := range steps {
		newshape := Shape{Pos{step.coords[0][0], step.coords[1][0], step.coords[2][0]}, Pos{step.coords[0][1], step.coords[1][1], step.coords[2][1]}, 0}
		newmap := make(map[Shape]bool)
		if step.on {
			newmap[newshape] = step.on
		}
		for shape, val := range shapes {
			intersection := intersect(newshape, shape)
			if intersection.volume >= 0 {
				remainder := non_intersect(shape, intersection)
				for _, ni := range remainder {
					newmap[ni] = val
				}
			} else {
				newmap[shape] = val
			}
		}
		shapes = newmap
	}

	fmt.Println()
	on := 0
	for k, v := range shapes {
		if v {
			on += volume(k)
		}
	}
	fmt.Println(on)
}

func volume(shape Shape) int {
	return (shape.end.x - shape.start.x + 1) * (shape.end.y - shape.start.y + 1) * (shape.end.z - shape.start.z + 1)
}

func intersect(left, right Shape) Shape {
	if inside(right.start, left) && inside(right.end, left) {
		return right
	} else if inside(left.start, right) && inside(left.end, right) {
		return left
	}
	if right.end.x < left.start.x || right.end.y < left.start.y || right.end.z < left.start.z {
		return Shape{Pos{0,0,0},Pos{0,0,0},-1}
	}
	if right.start.x > left.end.x || right.start.y > left.end.y || right.start.z > left.end.z {
		return Shape{Pos{0,0,0},Pos{0,0,0},-1}
	}

	var result Shape
	if right.start.x > left.start.x {
		result.start.x = right.start.x
	} else {
		result.start.x = left.start.x
	}
	if right.start.y > left.start.y {
		result.start.y = right.start.y
	} else {
		result.start.y = left.start.y
	}
	if right.start.z > left.start.z {
		result.start.z = right.start.z
	} else {
		result.start.z = left.start.z
	}

	if right.end.x < left.end.x {
		result.end.x = right.end.x
	} else {
		result.end.x = left.end.x
	}
	if right.end.y < left.end.y {
		result.end.y = right.end.y
	} else {
		result.end.y = left.end.y
	}
	if right.end.z < left.end.z {
		result.end.z = right.end.z
	} else {
		result.end.z = left.end.z
	}
	return result
}

// known when calling that there is an intersection
func non_intersect(original, intersect Shape) []Shape {
	result := make([]Shape, 0)
	if intersect == original {
		return result
	}

	// should be 26 cases

	// 8 like this: corners
	if intersect.start.x > original.start.x && intersect.start.y > original.start.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{original.start.x, original.start.y, original.start.z}, Pos{intersect.start.x-1, intersect.start.y-1, intersect.start.z-1}, 0})
	}
	if intersect.start.x > original.start.x && intersect.start.y > original.start.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{original.start.x, original.start.y, intersect.end.z+1}, Pos{intersect.start.x-1, intersect.start.y-1, original.end.z}, 0})
	}
	if intersect.start.x > original.start.x && intersect.end.y < original.end.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{original.start.x, intersect.end.y+1, original.start.z}, Pos{intersect.start.x-1, original.end.y, intersect.start.z-1}, 0})
	}
	if intersect.start.x > original.start.x && intersect.end.y < original.end.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{original.start.x, intersect.end.y+1, intersect.end.z+1}, Pos{intersect.start.x-1, original.end.y, original.end.z}, 0})
	}
	if intersect.end.x < original.end.x && intersect.start.y > original.start.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.end.x+1, original.start.y, original.start.z}, Pos{original.end.x, intersect.start.y-1, intersect.start.z-1}, 0})
	}
	if intersect.end.x < original.end.x && intersect.start.y > original.start.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.end.x+1, original.start.y, intersect.end.z+1}, Pos{original.end.x, intersect.start.y-1, original.end.z}, 0})
	}
	if intersect.end.x < original.end.x && intersect.end.y < original.end.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.end.y+1, original.start.z}, Pos{original.end.x, original.end.y, intersect.start.z-1}, 0})
	}
	if intersect.end.x < original.end.x && intersect.end.y < original.end.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.end.y+1, intersect.end.z+1}, Pos{original.end.x, original.end.y, original.end.z}, 0})
	}

	// 12 like this: edges
	if intersect.start.x > original.start.x && intersect.start.y > original.start.y {
		result = append(result, Shape{Pos{original.start.x, original.start.y, intersect.start.z}, Pos{intersect.start.x-1, intersect.start.y-1, intersect.end.z}, 0})
	}
	if intersect.start.x > original.start.x && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{original.start.x, intersect.start.y, original.start.z}, Pos{intersect.start.x-1, intersect.end.y, intersect.start.z-1}, 0})
	}
	if intersect.start.y > original.start.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.start.x, original.start.y, original.start.z}, Pos{intersect.end.x, intersect.start.y-1, intersect.start.z-1}, 0})
	}

	if intersect.end.x < original.end.x && intersect.start.y > original.start.y {
		result = append(result, Shape{Pos{intersect.end.x+1, original.start.y, intersect.start.z}, Pos{original.end.x, intersect.start.y-1, intersect.end.z}, 0})
	}
	if intersect.end.x < original.end.x && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.start.y, original.start.z}, Pos{original.end.x, intersect.end.y, intersect.start.z-1}, 0})
	}
	if intersect.start.x > original.start.x && intersect.end.y < original.end.y {
		result = append(result, Shape{Pos{original.start.x, intersect.end.y+1, intersect.start.z}, Pos{intersect.start.x-1, original.end.y, intersect.end.z}, 0})
	}
	if intersect.start.x > original.start.x && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{original.start.x, intersect.start.y, intersect.end.z+1}, Pos{intersect.start.x-1, intersect.end.y, original.end.z}, 0})
	}
	if intersect.end.y < original.end.y && intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.start.x, intersect.end.y+1, original.start.z}, Pos{intersect.end.x, original.end.y, intersect.start.z-1}, 0})
	}
	if intersect.start.y > original.start.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.start.x, original.start.y, intersect.end.z+1}, Pos{intersect.end.x, intersect.start.y-1, original.end.z}, 0})
	}

	if intersect.end.x < original.end.x && intersect.end.y < original.end.y {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.end.y+1, intersect.start.z}, Pos{original.end.x, original.end.y, intersect.end.z}, 0})
	}
	if intersect.end.x < original.end.x && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.start.y, intersect.end.z+1}, Pos{original.end.x, intersect.end.y, original.end.z}, 0})
	}
	if intersect.end.y < original.end.y && intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.start.x, intersect.end.y+1, intersect.end.z+1}, Pos{intersect.end.x, original.end.y, original.end.z}, 0})
	}

	// 6 like this: faces
	if intersect.start.x > original.start.x {
		result = append(result, Shape{Pos{original.start.x, intersect.start.y, intersect.start.z}, Pos{intersect.start.x-1, intersect.end.y, intersect.end.z}, 0})
	}
	if intersect.start.y > original.start.y {
		result = append(result, Shape{Pos{intersect.start.x, original.start.y, intersect.start.z}, Pos{intersect.end.x, intersect.start.y-1, intersect.end.z}, 0})
	}
	if intersect.start.z > original.start.z {
		result = append(result, Shape{Pos{intersect.start.x, intersect.start.y, original.start.z}, Pos{intersect.end.x, intersect.end.y, intersect.start.z-1}, 0})
	}
	if intersect.end.x < original.end.x {
		result = append(result, Shape{Pos{intersect.end.x+1, intersect.start.y, intersect.start.z}, Pos{original.end.x, intersect.end.y, intersect.end.z}, 0})
	}
	if intersect.end.y < original.end.y {
		result = append(result, Shape{Pos{intersect.start.x, intersect.end.y+1, intersect.start.z}, Pos{intersect.end.x, original.end.y, intersect.end.z}, 0})
	}
	if intersect.end.z < original.end.z {
		result = append(result, Shape{Pos{intersect.start.x, intersect.start.y, intersect.end.z+1}, Pos{intersect.end.x, intersect.end.y, original.end.z}, 0})
	}

	for _, shape := range result {
		if volume(shape) < 0 {
			fmt.Println("flag 1")
			fmt.Println()
			fmt.Println(original)
			fmt.Println(intersect)
			fmt.Println(shape)
			panic(0)
		}
	}
	return result
}

func inside(point Pos, shape Shape) bool {
	return point.x >= shape.start.x && point.x <= shape.start.x && point.y >= shape.start.y && point.y <= shape.start.y && point.z >= shape.start.z && point.z <= shape.start.z
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}