Powered by AppSignal & Oban Pro

Day 19

day_19.livemd

Day 19

Puzzle

As your probe drifted down through this area, it released an assortment of beacons and scanners into the water. It's difficult to navigate in the pitch black open waters of the ocean trench, but if you can build a map of the trench using data from the scanners, you should be able to safely reach the bottom.

The beacons and scanners float motionless in the water; they're designed to maintain the same position for long periods of time. Each scanner is capable of detecting all beacons in a large cube centered on the scanner; beacons that are at most 1000 units away from the scanner in each of the three axes (x, y, and z) have their precise position determined relative to the scanner. However, scanners cannot detect other scanners. The submarine has automatically summarized the relative positions of beacons detected by each scanner (your puzzle input).

For example, if a scanner is at x,y,z coordinates 500,0,-500 and there are beacons at -500,1000,-1500 and 1501,0,-500, the scanner could report that the first beacon is at -1000,1000,-1000 (relative to the scanner) but would not detect the second beacon at all.

Unfortunately, while each scanner can report the positions of all detected beacons relative to itself, the scanners do not know their own position. You'll need to determine the positions of the beacons and scanners yourself.

The scanners and beacons map a single contiguous 3d region. This region can be reconstructed by finding pairs of scanners that have overlapping detection regions such that there are at least 12 beacons that both scanners detect within the overlap. By establishing 12 common beacons, you can precisely determine where the scanners are relative to each other, allowing you to reconstruct the beacon map one scanner at a time.

For a moment, consider only two dimensions. Suppose you have the following scanner reports:

--- scanner 0 ---
0,2
4,1
3,3
--- scanner 1 ---
-1,-1
-5,0
-2,1

Drawing x increasing rightward, y increasing upward, scanners as S, and beacons as B, scanner 0 detects this:

...B.
B....
....B
S....

Scanner 1 detects this:

...B..
B....S
....B.

For this example, assume scanners only need 3 overlapping beacons. Then, the beacons visible to both scanners overlap to produce the following complete map:

...B..
B....S
....B.
S.....

Unfortunately, there's a second problem: the scanners also don't know their rotation or facing direction. Due to magnetic alignment, each scanner is rotated some integer number of 90-degree turns around all of the x, y, and z axes. That is, one scanner might call a direction positive x, while another scanner might call that direction negative y. Or, two scanners might agree on which direction is positive x, but one scanner might be upside-down from the perspective of the other scanner. In total, each scanner could be in any of 24 different orientations: facing positive or negative x, y, or z, and considering any of four directions "up" from that facing.

For example, here is an arrangement of beacons as seen from a scanner in the same position but in different orientations:

--- scanner 0 ---
-1,-1,1
-2,-2,2
-3,-3,3
-2,-3,1
5,6,-4
8,0,7
--- scanner 0 ---
1,-1,1
2,-2,2
3,-3,3
2,-1,3
-5,4,-6
-8,-7,0
--- scanner 0 ---
-1,-1,-1
-2,-2,-2
-3,-3,-3
-1,-3,-2
4,6,5
-7,0,8
--- scanner 0 ---
1,1,-1
2,2,-2
3,3,-3
1,3,-2
-4,-6,5
7,0,8
--- scanner 0 ---
1,1,1
2,2,2
3,3,3
3,1,2
-6,-4,-5
0,7,-8

By finding pairs of scanners that both see at least 12 of the same beacons, you can assemble the entire map. For example, consider the following report:

--- scanner 0 ---
404,-588,-901
528,-643,409
-838,591,734
390,-675,-793
-537,-823,-458
-485,-357,347
-345,-311,381
-661,-816,-575
-876,649,763
-618,-824,-621
553,345,-567
474,580,667
-447,-329,318
-584,868,-557
544,-627,-890
564,392,-477
455,729,728
-892,524,684
-689,845,-530
423,-701,434
7,-33,-71
630,319,-379
443,580,662
-789,900,-551
459,-707,401

--- scanner 1 ---
686,422,578
605,423,415
515,917,-361
-336,658,858
95,138,22
-476,619,847
-340,-569,-846
567,-361,727
-460,603,-452
669,-402,600
729,430,532
-500,-761,534
-322,571,750
-466,-666,-811
-429,-592,574
-355,545,-477
703,-491,-529
-328,-685,520
413,935,-424
-391,539,-444
586,-435,557
-364,-763,-893
807,-499,-711
755,-354,-619
553,889,-390

--- scanner 2 ---
649,640,665
682,-795,504
-784,533,-524
-644,584,-595
-588,-843,648
-30,6,44
-674,560,763
500,723,-460
609,671,-379
-555,-800,653
-675,-892,-343
697,-426,-610
578,704,681
493,664,-388
-671,-858,530
-667,343,800
571,-461,-707
-138,-166,112
-889,563,-600
646,-828,498
640,759,510
-630,509,768
-681,-892,-333
673,-379,-804
-742,-814,-386
577,-820,562

--- scanner 3 ---
-589,542,597
605,-692,669
-500,565,-823
-660,373,557
-458,-679,-417
-488,449,543
-626,468,-788
338,-750,-386
528,-832,-391
562,-778,733
-938,-730,414
543,643,-506
-524,371,-870
407,773,750
-104,29,83
378,-903,-323
-778,-728,485
426,699,580
-438,-605,-362
-469,-447,-387
509,732,623
647,635,-688
-868,-804,481
614,-800,639
595,780,-596

--- scanner 4 ---
727,592,562
-293,-554,779
441,611,-461
-714,465,-776
-743,427,-804
-660,-479,-426
832,-632,460
927,-485,-438
408,393,-506
466,436,-512
110,16,151
-258,-428,682
-393,719,612
-211,-452,876
808,-476,-593
-575,615,604
-485,667,467
-680,325,-822
-627,-443,-432
872,-547,-609
833,512,582
807,604,487
839,-516,451
891,-625,532
-652,-548,-490
30,-46,-14

Because all coordinates are relative, in this example, all "absolute" positions will be expressed relative to scanner 0 (using the orientation of scanner 0 and as if scanner 0 is at coordinates 0,0,0).

Scanners 0 and 1 have overlapping detection cubes; the 12 beacons they both detect (relative to scanner 0) are at the following coordinates:

-618,-824,-621
-537,-823,-458
-447,-329,318
404,-588,-901
544,-627,-890
528,-643,409
-661,-816,-575
390,-675,-793
423,-701,434
-345,-311,381
459,-707,401
-485,-357,347

These same 12 beacons (in the same order) but from the perspective of scanner 1 are:

686,422,578
605,423,415
515,917,-361
-336,658,858
-476,619,847
-460,603,-452
729,430,532
-322,571,750
-355,545,-477
413,935,-424
-391,539,-444
553,889,-390

Because of this, scanner 1 must be at 68,-1246,-43 (relative to scanner 0).

Scanner 4 overlaps with scanner 1; the 12 beacons they both detect (relative to scanner 0) are:

459,-707,401
-739,-1745,668
-485,-357,347
432,-2009,850
528,-643,409
423,-701,434
-345,-311,381
408,-1815,803
534,-1912,768
-687,-1600,576
-447,-329,318
-635,-1737,486

So, scanner 4 is at -20,-1133,1061 (relative to scanner 0).

Following this process, scanner 2 must be at 1105,-1205,1229 (relative to scanner 0) and scanner 3 must be at -92,-2380,-20 (relative to scanner 0).

The full list of beacons (relative to scanner 0) is:

-892,524,684
-876,649,763
-838,591,734
-789,900,-551
-739,-1745,668
-706,-3180,-659
-697,-3072,-689
-689,845,-530
-687,-1600,576
-661,-816,-575
-654,-3158,-753
-635,-1737,486
-631,-672,1502
-624,-1620,1868
-620,-3212,371
-618,-824,-621
-612,-1695,1788
-601,-1648,-643
-584,868,-557
-537,-823,-458
-532,-1715,1894
-518,-1681,-600
-499,-1607,-770
-485,-357,347
-470,-3283,303
-456,-621,1527
-447,-329,318
-430,-3130,366
-413,-627,1469
-345,-311,381
-36,-1284,1171
-27,-1108,-65
7,-33,-71
12,-2351,-103
26,-1119,1091
346,-2985,342
366,-3059,397
377,-2827,367
390,-675,-793
396,-1931,-563
404,-588,-901
408,-1815,803
423,-701,434
432,-2009,850
443,580,662
455,729,728
456,-540,1869
459,-707,401
465,-695,1988
474,580,667
496,-1584,1900
497,-1838,-617
527,-524,1933
528,-643,409
534,-1912,768
544,-627,-890
553,345,-567
564,392,-477
568,-2007,-577
605,-1665,1952
612,-1593,1893
630,319,-379
686,-3108,-505
776,-3184,-501
846,-3110,-434
1135,-1161,1235
1243,-1093,1063
1660,-552,429
1693,-557,386
1735,-437,1738
1749,-1800,1813
1772,-405,1572
1776,-675,371
1779,-442,1789
1780,-1548,337
1786,-1538,337
1847,-1591,415
1889,-1729,1762
1994,-1805,1792

In total, there are 79 beacons.

Assemble the full map of beacons. How many beacons are there?

Your puzzle input:

--- scanner 0 ---
841,866,478
-437,-775,-647
119,-8,72
631,448,-357
378,-633,749
752,-316,-718
-408,-736,-558
368,-621,627
-675,-734,554
-21,33,-80
-361,457,-746
653,-355,-631
-667,777,772
-659,-734,653
745,-489,-656
373,-642,759
-360,579,-799
767,476,-436
-346,498,-726
688,388,-535
-643,-825,592
-497,-772,-502
769,860,408
-756,714,660
797,828,435
-780,792,801

--- scanner 1 ---
124,-61,85
-802,710,-815
-535,-502,487
453,419,-333
778,-817,586
-811,-899,-870
-418,-530,391
-724,716,-858
-818,-918,-808
-655,-501,408
450,595,-368
-24,-126,-33
643,683,864
-792,-877,-659
853,-557,-587
749,-689,569
790,-548,-362
931,-503,-430
886,-785,530
-417,347,562
-435,285,587
541,711,782
551,541,-313
-475,258,484
-804,804,-864
625,832,829

--- scanner 2 ---
-529,-413,571
453,-450,517
-65,28,-52
843,625,384
-406,-479,503
811,-775,-557
892,-758,-702
70,-83,59
888,-660,-570
816,639,553
-626,635,-736
-835,-394,-412
-690,449,585
-535,375,569
-512,632,-683
-455,-386,616
904,618,490
856,340,-436
570,-401,439
-807,-332,-299
-793,-404,-273
445,-411,550
860,300,-592
-624,501,594
912,346,-451
-695,634,-688

--- scanner 3 ---
-832,383,504
-424,-716,-425
391,338,-430
-762,-583,599
364,-449,-307
-784,-591,543
521,243,351
-834,423,569
-501,-748,-479
-849,478,341
462,296,-448
458,-451,-356
452,-529,-313
753,-646,895
-373,225,-484
-395,381,-429
584,278,440
665,-550,804
568,340,-371
-46,-187,-73
-640,-715,-422
754,-628,864
74,-95,68
620,256,519
-759,-492,572
-416,337,-506

--- scanner 4 ---
-526,-486,-764
-557,-506,685
-4,138,-63
747,428,763
422,-425,551
-646,822,481
671,485,686
751,510,843
432,-706,-400
365,-393,580
516,-753,-279
-543,-509,655
-544,-511,-826
-161,-28,109
-647,825,697
534,-788,-428
-542,-392,576
-833,934,-395
442,389,-570
-913,940,-307
-911,891,-401
402,-266,531
341,444,-516
-614,768,558
344,409,-692
-584,-408,-853

--- scanner 5 ---
-612,-752,659
-569,313,-659
837,575,-546
970,-856,665
-684,749,411
-647,224,-601
734,-789,-406
-740,-564,-658
-732,701,389
-641,-733,575
684,499,930
96,-94,151
940,-930,661
-644,-536,-541
810,-929,-336
684,-995,-409
799,434,-521
-723,-535,-421
-544,251,-641
700,468,751
917,-969,673
659,430,727
157,-169,-18
812,497,-511
-645,-763,577
-713,733,490

--- scanner 6 ---
685,-799,-730
-856,764,721
767,-795,-650
710,-719,-573
-651,731,-706
806,-490,683
370,599,-584
-635,-366,-510
-709,-358,-561
304,863,514
-624,822,-703
-59,-50,141
373,598,-368
751,-389,629
-595,723,-728
-916,686,810
-947,668,809
255,865,420
-739,-439,-577
427,566,-445
-597,-748,926
-561,-768,945
16,68,30
786,-392,805
-446,-866,950
261,785,508

--- scanner 7 ---
-773,510,756
-904,665,-683
-949,599,-518
599,799,629
-122,-111,-95
560,662,533
-686,-754,805
-839,-617,-765
347,454,-867
542,-522,-441
-863,658,722
738,-505,374
-801,-642,-624
-32,49,-190
-834,542,-642
-814,-652,-687
-873,692,746
300,538,-988
-736,-757,599
265,556,-839
-812,-827,739
543,691,661
642,-622,346
567,-504,-503
721,-742,345
645,-562,-414

--- scanner 8 ---
591,507,446
-24,-53,76
291,-839,-788
720,595,-724
-931,685,775
-936,800,873
717,622,-815
253,-674,-878
575,537,365
756,-701,477
-774,-617,-378
-795,299,-661
774,-704,387
-916,-786,713
730,-707,333
524,611,373
-796,330,-679
-750,-620,-626
310,-692,-770
-802,-553,-457
-912,649,755
-139,-3,-69
-924,-814,853
742,651,-716
-850,-876,753
-707,390,-757

--- scanner 9 ---
-663,409,-813
-953,-659,410
-679,-681,-393
-172,-111,-37
711,-696,501
317,320,-547
430,380,-475
-654,-773,-527
-592,-780,-354
692,-496,-715
647,-611,-738
-511,332,541
-752,380,-774
694,591,706
574,-578,-619
644,488,757
-584,318,460
731,456,700
-808,469,-810
684,-722,342
-564,333,419
594,-664,467
-19,-61,110
362,533,-510
-874,-795,438
-775,-716,350

--- scanner 10 ---
148,54,70
436,520,-758
-546,484,939
483,-506,-708
562,766,589
-710,-455,-728
516,-426,-674
-710,-406,-529
-630,436,-728
808,-512,862
-481,-592,642
-579,-572,604
-711,545,-658
53,-59,-30
397,-457,-576
-825,-416,-690
-743,553,-734
609,564,-714
849,-492,847
-562,477,880
568,803,724
500,584,-616
-372,-516,616
-449,523,881
511,716,692
727,-439,848

--- scanner 11 ---
-578,-588,-612
-592,764,604
675,-691,-838
-696,-506,-516
650,-783,-704
741,541,452
-768,-510,515
528,-859,660
-321,310,-684
748,370,-457
780,637,315
481,-980,576
-682,730,456
804,459,-421
588,-790,-877
724,669,423
-723,-675,449
446,-831,558
-692,754,422
-434,370,-756
659,399,-418
-366,523,-721
95,-125,-32
-651,-621,-493
-653,-634,572

--- scanner 12 ---
467,-550,715
392,226,328
401,-618,592
-758,-950,-812
-513,-641,497
-452,524,-735
-484,426,-811
441,-799,-797
-20,-61,-47
320,252,314
-775,-959,-765
374,-663,666
455,296,-580
322,-860,-796
471,320,-467
-387,-616,586
-718,-886,-874
382,365,286
462,234,-634
-461,-632,431
-644,636,609
-647,689,495
369,-914,-703
-646,641,426
-436,541,-878

--- scanner 13 ---
899,-482,499
-819,-499,-793
881,406,377
839,388,306
-720,-501,-825
921,-561,535
162,-94,42
-510,808,-818
840,464,-501
-783,-387,-816
754,-611,-919
-587,782,-774
796,387,-480
952,442,-458
-457,359,741
-259,-482,738
-543,505,803
934,-393,436
794,-546,-917
-13,24,-8
-663,739,-878
-481,575,711
54,-112,-152
-408,-501,824
837,329,483
699,-383,-934
-374,-520,779

--- scanner 14 ---
-807,418,-860
-566,-459,811
489,-805,-464
-517,853,594
-147,40,75
-855,422,-859
489,-749,-657
694,809,-457
-792,470,-862
-613,-334,-398
461,-515,729
449,816,639
588,759,672
-635,-421,-365
-541,-417,902
-517,-443,-422
716,754,-301
665,813,640
-658,-447,847
-632,822,686
673,732,-413
491,-518,743
552,-832,-670
-536,819,802
570,-401,744

--- scanner 15 ---
-664,866,-690
571,581,638
699,-911,536
15,-110,108
-367,609,572
171,39,62
466,-885,-546
-624,746,-657
443,-846,-534
573,-845,463
584,518,648
-514,880,-620
649,-705,533
-414,560,573
-421,828,592
-340,-747,623
413,-772,-538
724,514,-600
546,659,673
-320,-542,642
699,583,-803
-535,-366,-603
-490,-544,-673
-460,-461,-715
683,552,-624
-280,-694,649

--- scanner 16 ---
657,-803,337
735,-887,433
-701,277,478
-729,373,595
-674,-701,-793
637,454,368
614,-719,-462
-414,472,-718
461,-695,-421
624,616,457
-730,294,715
-728,-544,-871
-313,-922,878
-354,-773,852
585,-781,-379
-683,-476,-730
-332,-984,871
98,-83,93
647,728,353
-446,416,-826
747,-699,395
763,526,-566
882,441,-647
-29,1,-75
692,391,-653
-542,455,-689

--- scanner 17 ---
560,-817,-789
464,-716,248
-719,-913,-731
412,709,-910
441,694,-797
-706,397,366
-692,-462,337
41,-72,-37
735,783,711
-640,526,-488
-624,681,-562
778,745,667
-35,43,-161
-615,615,-614
805,777,639
-825,-852,-738
621,-908,-773
454,-725,243
586,-704,238
-770,-579,288
659,-817,-805
-638,520,300
-659,-454,298
-656,-825,-752
553,631,-886
-593,446,273

--- scanner 18 ---
640,490,-580
-722,824,-411
911,-424,472
-594,-399,-587
-678,718,-334
418,463,477
533,422,515
860,-462,515
9,131,118
702,398,-510
-443,-415,-548
616,460,-364
-680,895,-393
-554,-611,744
489,-548,-658
420,-443,-619
-421,-631,841
-483,-393,-690
123,54,-22
-461,-711,785
-762,666,556
470,-384,-606
-775,765,388
827,-471,439
-740,702,477
567,377,496

--- scanner 19 ---
830,819,436
-656,414,775
-449,739,-509
-550,-653,-557
485,-697,-452
432,-640,788
492,-487,857
-568,-702,411
809,863,513
-434,657,-404
852,975,491
391,777,-562
-671,416,827
393,817,-497
536,-564,831
-734,-612,380
8,147,42
494,-760,-338
517,-796,-450
-618,-602,320
-688,-546,-547
-668,-529,-519
-719,417,823
-395,642,-505
376,722,-334

--- scanner 20 ---
-879,448,-699
-690,-357,326
302,341,795
-411,-288,-509
595,-312,-628
346,-755,492
-365,-340,-650
326,459,644
314,361,-819
710,-389,-615
388,461,-881
-860,566,-664
49,-61,-63
-683,-296,432
307,439,680
-130,16,56
385,-747,459
693,-308,-760
322,501,-791
-704,-384,495
-405,-344,-494
336,-630,381
-438,541,423
-874,524,-621
-455,612,565
-538,504,484

--- scanner 21 ---
-83,1,-130
-454,-473,417
-456,639,684
579,-740,-933
754,457,-696
-365,677,652
653,402,-642
-557,834,-369
318,-441,684
455,-480,588
-49,140,61
-701,-571,-736
-456,738,668
414,451,447
-418,-417,506
663,-693,-812
-415,-562,446
-835,-546,-644
751,422,-520
351,676,456
426,-497,716
561,-775,-784
-548,844,-364
273,519,402
-569,712,-359
-874,-633,-743

--- scanner 22 ---
-658,-705,-572
723,-800,-896
-500,366,465
-521,592,-679
911,230,-446
17,-169,-24
411,612,524
748,-818,-834
494,599,587
-507,438,503
892,331,-414
-633,-670,-650
438,406,587
-466,-396,478
-445,-451,425
842,-802,506
142,0,-4
728,-787,615
725,-801,585
-620,-680,-713
863,252,-398
-344,-402,554
-429,400,476
826,-760,-923
-480,568,-717
-505,771,-648

--- scanner 23 ---
444,347,940
524,435,934
-599,-554,-823
-345,551,876
-301,445,799
800,-645,-506
-318,384,-342
710,-657,825
-230,-390,763
-239,368,-371
31,-5,-13
-586,-617,-740
743,-518,768
773,893,-408
813,866,-511
-393,-617,-796
446,441,891
-343,374,817
831,804,-486
-386,-412,818
-217,416,-323
711,-441,822
-342,-433,741
815,-536,-392
814,-615,-509

--- scanner 24 ---
523,622,-320
426,669,402
-278,-855,-461
-367,525,855
82,34,89
718,-489,-676
521,799,-379
-252,-896,-312
-445,436,915
439,570,570
461,606,491
-789,-566,438
-259,-877,-250
647,-707,758
-684,-563,556
479,728,-397
-268,732,-305
780,-727,855
-266,826,-256
758,-511,-534
-744,-533,409
-463,437,946
607,-495,-573
-346,738,-262
740,-807,799

--- scanner 25 ---
796,556,581
-455,678,367
-522,814,437
65,58,-142
766,-346,-544
759,-556,765
-845,697,-942
884,557,641
-862,-523,462
-797,-807,-525
757,-283,-430
819,-403,696
-883,-658,-544
-387,850,411
-837,657,-737
715,-479,739
-70,155,-29
-800,-609,316
-838,-692,-563
794,869,-913
-796,809,-841
725,486,656
597,847,-929
-770,-585,532
734,-247,-542
803,867,-883

--- scanner 26 ---
14,-88,-49
-725,-560,-817
777,692,602
-581,-731,770
-551,233,470
422,-684,844
774,495,-514
-466,-787,868
-555,-506,-795
849,-745,-850
778,465,-516
-601,439,467
118,-164,78
745,476,-598
873,664,719
534,-661,740
821,-692,-897
-677,299,397
-413,-718,795
696,-674,829
-784,259,-612
889,-718,-809
-669,-599,-870
856,693,482
-807,298,-600
-837,372,-604

--- scanner 27 ---
-426,769,729
841,587,742
-364,-756,731
822,552,624
-474,446,-481
836,509,666
476,629,-789
354,758,-765
-360,679,689
-480,-437,-703
-345,-792,751
519,-796,-464
417,-677,578
400,-535,649
-481,-406,-685
522,-914,-359
-57,-172,26
500,-596,686
489,-943,-404
-352,707,829
-340,-907,849
-526,513,-650
-569,-497,-781
-502,510,-402
419,605,-748

--- scanner 28 ---
-907,-710,523
800,620,-631
-955,-749,-451
-175,-105,-16
542,-449,482
-45,47,121
461,-813,-346
758,637,-711
-882,-681,424
631,-389,560
-700,437,-426
-456,780,451
-475,633,469
630,-358,578
-418,615,361
-885,-654,515
398,-902,-311
497,-734,-324
609,558,861
637,494,782
-915,457,-461
796,618,-630
-957,-684,-491
-803,493,-545
-972,-912,-546
585,561,613

--- scanner 29 ---
605,-795,-500
463,-848,-520
-38,-105,56
541,-841,363
588,666,-512
-752,569,-552
395,778,663
596,676,-571
-693,531,-666
454,809,632
-785,-661,-307
582,-913,421
389,-780,-487
-723,584,536
-618,532,-539
-740,-506,444
357,871,698
-524,-633,-314
-614,564,438
-707,-426,478
-623,-681,-414
429,637,-546
-787,520,394
-826,-457,576
43,77,-41
550,-703,416

--- scanner 30 ---
693,-800,795
-634,573,590
-605,414,556
387,565,-766
-500,-633,563
-504,890,-770
580,-577,-686
-759,-758,-612
523,-442,-698
99,112,-125
-644,581,531
-714,-767,-573
713,-638,688
-587,-733,-542
-537,-767,550
665,-539,788
-433,855,-589
587,-569,-706
880,448,582
-33,-35,-153
-537,739,-661
-499,-708,436
827,590,602
550,658,-740
459,643,-811
812,374,615

--- scanner 31 ---
-449,-739,803
559,521,-705
-856,583,826
641,-722,711
-369,-706,769
-784,542,884
773,-711,-597
-679,856,-616
-646,551,831
621,-613,809
-400,-825,671
-382,-495,-753
-39,-64,-14
491,556,-552
-435,-373,-752
118,125,-47
577,-786,853
928,358,549
-534,859,-676
866,455,615
-623,820,-705
835,396,584
-455,-414,-767
823,-660,-494
446,593,-765
860,-654,-629
18,49,121

Setup

Mix.install([
  {:kino, "~> 0.4.1"}
])
input = Kino.Input.textarea("Please provide your input: ")
input =
  input
  |> Kino.Input.read()

Part 1