diff --git a/12-input.txt b/12-input.txt new file mode 100644 index 0000000..7c08309 --- /dev/null +++ b/12-input.txt @@ -0,0 +1,1030 @@ +0: +### +.## +..# + +1: +#.. +### +### + +2: +#.# +### +#.# + +3: +#.# +### +##. + +4: +### +..# +### + +5: +.## +##. +#.. + +38x48: 18 40 41 41 30 21 +47x37: 46 45 45 43 49 38 +38x45: 51 41 32 51 46 43 +48x44: 43 41 38 32 23 47 +46x38: 34 38 46 60 46 43 +45x38: 32 31 34 20 33 30 +43x37: 50 33 39 39 40 47 +38x39: 28 33 19 28 25 23 +48x36: 24 43 31 33 26 35 +43x40: 48 38 39 45 50 46 +45x47: 67 57 50 50 53 49 +41x41: 28 36 24 24 28 29 +45x44: 41 53 47 53 57 53 +36x43: 31 31 32 23 23 27 +44x40: 61 39 50 42 39 41 +44x46: 41 45 31 34 32 27 +42x39: 28 31 31 46 20 25 +41x48: 53 48 53 38 60 52 +38x49: 32 33 34 31 28 34 +42x35: 30 51 35 38 40 29 +49x47: 54 73 49 56 65 56 +48x50: 61 64 68 63 56 56 +48x42: 33 35 35 37 46 37 +49x39: 31 30 31 37 39 39 +38x39: 25 26 20 32 24 28 +41x45: 35 29 34 37 29 30 +45x46: 47 58 45 48 66 54 +36x44: 38 42 46 38 38 42 +39x35: 20 21 25 24 28 24 +47x47: 55 52 73 51 50 60 +38x43: 36 40 44 41 42 50 +47x38: 50 48 41 40 57 37 +43x46: 37 37 31 35 37 33 +45x50: 58 58 56 66 55 52 +48x40: 26 39 35 41 29 37 +45x38: 43 46 48 44 41 40 +46x36: 47 34 40 45 46 44 +37x40: 24 30 27 29 23 23 +49x44: 38 47 28 41 34 35 +38x45: 39 47 45 39 51 41 +43x37: 33 47 42 48 35 38 +40x48: 43 31 36 22 45 31 +35x39: 24 39 34 37 41 33 +50x41: 46 59 55 52 59 40 +37x49: 35 26 36 37 29 29 +36x38: 31 34 36 41 36 31 +47x41: 41 49 50 54 53 48 +41x49: 61 51 49 51 41 60 +49x49: 61 56 66 68 59 59 +38x48: 26 36 33 28 37 32 +45x41: 26 43 30 32 34 29 +41x41: 42 46 49 39 42 40 +43x38: 27 32 27 24 28 30 +36x47: 43 45 51 39 36 48 +47x37: 22 34 23 36 25 39 +49x37: 37 29 27 37 31 30 +43x38: 47 43 45 45 29 44 +36x38: 29 26 35 51 34 35 +48x45: 48 44 32 42 44 30 +37x48: 25 36 29 32 37 32 +35x46: 37 34 38 47 46 47 +39x36: 36 40 42 21 37 42 +49x49: 40 49 35 50 37 44 +40x42: 39 46 48 42 35 50 +35x41: 42 43 37 34 28 38 +37x35: 39 33 29 36 26 39 +42x46: 32 31 36 35 35 40 +41x38: 42 46 33 39 41 39 +37x49: 44 36 36 62 54 47 +43x36: 38 36 53 37 38 35 +43x41: 39 57 47 42 42 43 +37x38: 15 30 29 22 23 24 +36x49: 53 46 29 58 46 39 +43x40: 31 57 46 35 45 51 +45x48: 47 38 37 36 39 43 +35x35: 28 35 30 28 39 27 +41x43: 34 41 59 46 40 52 +41x46: 48 50 48 50 44 51 +35x42: 35 45 37 33 31 48 +40x50: 51 48 53 55 50 51 +39x36: 34 44 31 33 43 29 +45x38: 57 36 42 36 53 40 +50x38: 50 54 45 51 39 56 +46x48: 33 42 56 31 42 36 +37x44: 32 29 33 16 26 31 +44x38: 40 51 48 36 39 43 +47x45: 37 42 37 32 40 36 +48x37: 52 33 47 48 47 48 +50x46: 35 40 39 39 35 51 +36x43: 32 44 38 41 39 45 +42x49: 50 52 57 53 50 55 +50x40: 52 53 47 52 51 54 +46x42: 34 27 35 31 45 37 +46x43: 54 45 58 48 50 50 +40x39: 33 31 34 26 27 17 +47x43: 59 50 36 65 49 54 +39x35: 16 18 30 22 30 27 +42x48: 32 32 36 32 48 43 +45x45: 33 40 41 32 43 35 +36x44: 38 41 40 54 32 38 +39x45: 44 26 30 31 31 33 +38x49: 43 50 59 54 33 47 +38x47: 44 53 42 45 44 47 +42x43: 38 30 31 31 31 35 +36x41: 36 25 22 21 21 30 +41x49: 40 51 53 52 57 56 +40x43: 55 36 38 51 39 49 +40x46: 40 42 50 53 51 46 +49x48: 68 65 57 57 57 59 +45x41: 32 37 24 41 28 33 +35x38: 38 31 36 28 37 36 +38x49: 46 49 50 39 51 53 +38x41: 38 33 34 46 45 45 +50x46: 56 59 51 66 60 63 +47x48: 45 46 36 41 37 34 +49x39: 37 25 36 34 43 33 +47x45: 66 44 51 49 61 57 +42x37: 36 43 48 37 39 34 +39x36: 22 41 35 32 46 39 +47x47: 44 36 36 45 35 29 +47x41: 42 48 45 50 61 50 +46x41: 31 28 32 28 37 38 +41x49: 49 51 63 49 55 38 +43x39: 58 30 39 45 44 45 +48x40: 33 32 36 41 30 35 +44x39: 24 32 24 28 39 34 +43x48: 38 44 33 38 44 27 +38x43: 27 29 23 38 27 23 +49x45: 41 29 49 43 34 43 +49x39: 30 37 34 32 41 33 +48x47: 62 52 57 54 63 61 +46x38: 60 46 37 44 46 36 +40x42: 29 28 30 39 31 25 +44x46: 51 60 47 46 54 54 +41x50: 46 51 68 42 59 47 +35x50: 33 25 24 36 22 35 +40x47: 34 35 29 34 27 35 +35x43: 22 24 28 23 28 28 +45x45: 46 53 53 52 60 45 +44x42: 49 39 54 52 46 44 +38x45: 25 24 30 36 38 27 +48x39: 56 42 46 41 45 64 +44x48: 54 51 45 55 62 60 +35x41: 25 17 24 29 24 24 +41x39: 46 49 35 28 45 45 +42x47: 53 43 49 49 58 53 +43x41: 47 57 45 43 42 35 +50x37: 24 32 36 34 39 26 +35x42: 31 28 43 47 35 43 +50x48: 69 57 69 52 69 52 +45x49: 50 65 52 52 60 61 +43x42: 32 35 30 30 32 37 +43x40: 29 27 24 38 36 27 +42x44: 33 25 40 32 33 33 +40x47: 55 40 40 47 52 60 +48x37: 28 30 31 33 32 38 +38x37: 18 19 28 25 23 31 +44x39: 25 38 24 35 29 30 +48x36: 33 35 28 26 34 36 +40x44: 41 46 43 52 39 51 +48x46: 70 63 47 59 54 46 +38x49: 28 28 32 37 31 36 +41x44: 40 49 46 51 39 54 +46x48: 31 44 42 32 43 48 +43x41: 34 28 23 34 37 26 +44x44: 33 36 34 38 27 28 +45x37: 41 44 51 40 36 45 +39x39: 35 34 41 43 41 40 +40x38: 28 41 47 48 34 33 +38x44: 26 34 31 29 21 26 +38x40: 48 38 31 40 45 31 +38x47: 57 45 47 38 46 43 +47x42: 52 48 58 57 46 40 +37x42: 47 32 35 40 43 45 +45x48: 51 52 48 65 63 52 +40x48: 52 56 45 41 50 53 +38x35: 24 27 27 12 30 11 +40x41: 32 29 30 21 27 29 +49x46: 66 59 48 53 60 64 +39x39: 46 43 38 39 34 34 +36x48: 41 36 28 35 23 29 +40x50: 56 46 42 59 53 53 +42x47: 36 33 32 44 31 34 +36x47: 42 38 44 43 46 49 +38x41: 32 32 36 52 46 41 +39x40: 37 36 44 44 41 37 +45x35: 51 35 37 46 40 33 +36x43: 46 34 45 35 43 35 +46x42: 58 52 46 55 38 50 +38x47: 35 18 25 32 39 30 +46x48: 33 30 42 49 42 44 +44x47: 56 54 40 71 47 50 +46x44: 40 57 49 46 66 52 +36x36: 33 29 36 31 34 38 +48x45: 41 39 28 63 38 30 +35x39: 18 23 31 25 21 24 +42x37: 37 38 46 34 46 37 +47x45: 60 65 56 47 50 46 +39x47: 55 61 42 42 37 46 +37x46: 30 31 25 33 34 26 +50x48: 75 55 57 69 57 57 +40x47: 34 34 28 32 30 36 +42x46: 46 52 51 51 52 43 +36x35: 19 27 15 30 23 18 +46x37: 54 43 37 44 38 49 +48x40: 29 30 34 36 39 39 +49x50: 49 43 38 35 44 46 +36x44: 36 28 30 31 20 22 +48x46: 41 37 40 42 39 41 +49x49: 63 53 66 68 71 44 +39x42: 43 52 45 33 46 30 +45x43: 36 36 40 29 31 38 +43x40: 41 29 27 31 28 25 +37x44: 40 33 52 38 47 40 +48x41: 43 49 55 51 49 57 +36x47: 32 25 27 38 34 24 +48x37: 33 29 41 39 27 23 +45x41: 32 28 30 39 36 30 +39x46: 37 24 35 26 41 32 +46x46: 44 58 51 56 59 57 +47x38: 48 45 44 52 47 37 +39x49: 55 48 38 54 47 55 +37x35: 38 41 27 33 28 33 +45x43: 54 60 40 59 48 33 +41x42: 58 30 45 51 40 43 +38x37: 32 30 32 37 46 40 +40x39: 34 51 44 32 44 32 +35x50: 38 52 48 45 47 36 +48x50: 44 32 40 44 43 53 +44x37: 27 24 29 37 27 24 +43x43: 53 52 48 46 45 39 +45x35: 40 46 40 41 39 35 +41x50: 60 56 53 47 45 57 +45x35: 40 48 49 34 28 45 +50x40: 41 33 42 21 31 40 +50x49: 50 58 66 69 66 68 +45x45: 36 36 36 38 45 34 +41x45: 42 47 47 59 45 42 +36x47: 39 26 32 22 33 28 +41x36: 31 24 27 25 26 23 +36x39: 35 28 35 40 42 36 +43x42: 27 33 24 49 31 32 +36x50: 31 28 43 23 30 36 +45x43: 56 47 48 62 43 40 +41x36: 24 27 21 30 26 27 +50x36: 34 22 38 30 39 29 +44x45: 58 46 54 58 46 41 +48x43: 40 41 35 31 40 36 +38x38: 41 38 37 30 40 37 +49x45: 52 55 60 55 63 53 +45x44: 52 48 51 50 59 43 +36x43: 38 50 35 37 36 43 +38x42: 43 38 39 46 39 41 +39x47: 30 40 31 28 40 26 +42x44: 40 46 46 59 47 45 +38x48: 28 30 29 39 34 31 +41x48: 33 53 51 58 51 56 +46x46: 60 50 42 66 48 63 +40x44: 52 50 44 35 49 41 +47x48: 54 35 33 37 38 43 +47x45: 83 52 37 58 52 45 +35x38: 31 37 36 34 28 40 +45x46: 44 54 62 56 47 55 +35x40: 37 36 31 29 42 43 +46x38: 39 46 46 47 51 37 +50x41: 55 56 40 54 64 45 +45x45: 46 55 49 61 50 49 +50x50: 78 64 68 57 50 72 +35x49: 43 43 45 46 43 44 +41x49: 41 70 51 44 43 62 +49x45: 59 47 51 64 62 57 +42x41: 51 43 25 52 52 43 +48x39: 23 30 36 38 37 43 +44x50: 66 45 68 44 49 73 +41x37: 35 37 45 37 36 45 +41x42: 46 46 38 54 34 49 +37x49: 27 32 35 32 29 36 +36x35: 15 25 22 22 24 24 +46x47: 56 70 56 49 51 49 +48x41: 33 42 43 26 31 33 +45x46: 49 58 54 53 57 45 +46x35: 35 24 27 28 19 32 +38x36: 28 17 19 27 29 24 +39x40: 43 33 40 51 33 41 +45x48: 33 45 41 36 41 44 +41x35: 39 34 34 36 40 39 +41x49: 58 55 35 59 58 43 +43x42: 42 41 49 42 54 51 +35x39: 18 19 24 23 33 25 +37x48: 24 36 40 26 34 32 +38x39: 33 32 42 37 40 46 +40x37: 24 25 21 31 30 25 +39x40: 45 39 24 46 40 50 +41x40: 44 44 38 39 45 43 +41x40: 38 48 45 47 42 28 +49x48: 54 64 64 66 61 49 +36x35: 32 38 27 27 35 36 +35x42: 29 23 26 26 26 23 +46x38: 50 38 43 45 41 56 +42x42: 32 36 28 36 35 29 +39x41: 48 34 34 46 38 50 +38x50: 47 50 50 48 50 47 +36x45: 48 30 36 51 38 50 +41x47: 52 59 49 56 39 39 +49x42: 36 29 39 38 44 37 +47x47: 60 49 59 60 55 58 +35x37: 24 18 21 14 28 27 +38x35: 29 34 39 39 30 33 +38x49: 30 23 36 34 32 36 +48x36: 46 47 41 44 43 46 +50x37: 29 29 33 32 36 32 +41x42: 36 50 34 55 43 47 +47x50: 39 41 43 41 32 44 +47x40: 41 48 47 44 56 54 +39x47: 39 52 55 40 44 53 +35x35: 23 36 29 42 33 22 +35x50: 24 27 22 46 22 34 +46x45: 32 40 34 44 44 30 +46x36: 32 36 25 36 30 20 +41x36: 35 40 44 41 27 41 +39x46: 43 41 47 39 50 60 +43x42: 39 43 45 46 55 50 +48x48: 60 79 53 50 54 59 +35x38: 18 29 24 17 25 18 +42x46: 30 28 40 36 41 35 +49x48: 32 42 51 39 49 42 +37x44: 25 31 21 33 32 26 +42x36: 30 33 21 28 26 29 +37x42: 32 45 42 42 40 36 +40x49: 37 33 42 34 29 32 +36x37: 20 25 26 25 19 29 +45x44: 34 42 31 35 33 35 +47x35: 38 43 43 45 41 43 +46x45: 56 63 49 49 49 53 +37x38: 22 32 30 18 21 20 +44x40: 51 40 36 56 43 46 +36x47: 30 35 29 22 36 27 +43x45: 29 43 28 44 28 37 +37x46: 37 53 42 38 51 39 +35x43: 40 47 43 34 30 38 +48x45: 54 63 54 52 58 50 +35x41: 28 16 23 27 29 20 +42x41: 53 45 54 33 34 49 +49x40: 53 48 59 50 47 43 +41x50: 34 27 39 34 39 34 +44x37: 35 35 25 23 27 22 +43x42: 43 48 55 44 46 40 +41x44: 42 47 55 45 47 39 +36x48: 57 46 37 40 44 44 +46x48: 35 33 41 49 49 32 +36x40: 32 34 49 29 36 43 +43x44: 49 55 41 50 51 44 +44x46: 33 32 32 50 30 32 +46x49: 44 42 31 30 50 42 +45x50: 56 58 51 56 60 68 +43x41: 26 36 37 22 33 27 +46x37: 54 39 39 30 50 55 +40x43: 36 44 50 43 46 45 +36x49: 44 44 53 48 39 43 +47x35: 28 27 25 30 27 28 +36x47: 28 39 28 24 36 25 +48x41: 51 63 39 66 41 40 +47x47: 38 37 31 38 38 43 +43x49: 32 39 34 33 42 43 +39x45: 47 50 44 41 45 43 +48x42: 43 44 54 59 48 65 +48x50: 57 57 59 74 58 65 +44x37: 40 50 27 42 51 40 +36x47: 31 20 35 23 37 34 +48x49: 60 50 65 55 69 64 +46x41: 47 49 49 45 47 55 +40x44: 28 30 34 23 35 32 +38x36: 43 35 35 37 34 25 +43x37: 54 29 33 48 40 44 +43x36: 34 30 23 25 24 31 +38x36: 29 35 34 36 43 32 +36x45: 48 39 37 41 38 50 +41x50: 56 55 54 51 45 56 +36x35: 20 21 23 20 22 26 +39x44: 46 50 39 42 48 38 +46x39: 32 22 35 38 39 29 +38x49: 30 29 38 39 28 27 +41x46: 34 31 28 36 32 34 +49x39: 44 46 52 59 48 43 +49x46: 65 49 63 57 66 44 +41x43: 34 50 46 53 42 45 +38x41: 27 25 23 22 34 25 +35x37: 37 37 33 27 36 29 +41x44: 30 27 24 29 35 36 +41x36: 36 33 39 41 35 45 +40x44: 49 35 46 58 37 47 +37x50: 40 53 48 52 45 45 +50x41: 38 32 35 34 31 37 +40x45: 49 39 47 49 52 40 +46x49: 48 67 56 58 60 56 +41x45: 41 31 42 24 28 29 +36x48: 52 45 37 36 41 61 +45x49: 47 35 37 41 46 33 +44x45: 47 65 66 46 28 53 +48x46: 55 55 61 57 50 64 +38x42: 44 41 38 38 40 47 +36x36: 23 25 25 22 21 27 +50x41: 57 48 64 48 48 51 +37x43: 30 44 44 37 46 43 +45x48: 44 43 32 42 41 38 +48x39: 42 39 33 35 29 30 +39x48: 54 51 52 30 49 55 +46x50: 35 45 42 43 35 40 +38x41: 43 34 29 42 49 45 +45x44: 53 52 57 53 45 43 +38x45: 39 28 30 32 27 24 +49x39: 41 46 40 62 45 63 +42x49: 47 51 58 60 50 49 +48x40: 31 21 37 39 42 37 +40x48: 39 49 46 64 55 38 +40x37: 32 38 36 40 39 44 +35x48: 39 46 43 47 35 50 +44x40: 40 43 38 46 56 48 +35x42: 23 21 12 34 31 32 +45x35: 33 28 26 26 21 30 +39x45: 41 45 47 53 46 35 +43x47: 35 35 29 35 39 36 +36x48: 52 40 42 42 48 43 +43x43: 47 57 33 45 47 59 +41x49: 56 50 63 43 49 48 +45x38: 38 43 38 47 47 52 +42x47: 44 59 59 49 46 44 +39x37: 21 29 19 31 26 30 +36x46: 40 45 32 39 55 44 +49x37: 45 46 49 45 50 43 +41x45: 36 24 38 29 33 34 +41x46: 35 34 31 30 32 33 +42x49: 49 47 71 51 46 52 +35x50: 28 28 30 27 32 31 +44x40: 24 36 38 25 33 25 +41x50: 60 56 47 55 50 47 +39x42: 41 33 39 46 56 35 +35x40: 39 39 43 29 33 32 +40x48: 34 37 38 33 28 38 +36x44: 40 39 45 48 39 30 +40x47: 43 50 52 46 49 49 +42x40: 27 27 35 36 27 29 +44x45: 41 51 49 56 55 52 +42x43: 36 30 35 39 34 21 +49x43: 26 41 37 42 42 36 +37x49: 34 45 37 26 18 32 +39x48: 49 39 44 42 63 53 +40x35: 32 39 34 36 33 43 +40x48: 34 29 28 38 40 38 +45x35: 38 41 32 40 49 43 +40x48: 49 53 51 53 45 43 +40x40: 44 34 42 42 44 41 +36x48: 23 42 35 26 27 39 +37x35: 35 29 42 27 33 34 +47x45: 44 39 34 35 39 33 +49x40: 47 58 52 45 48 52 +43x49: 55 45 63 49 62 49 +36x48: 50 47 40 33 55 41 +50x35: 39 24 33 24 30 25 +42x43: 41 41 45 56 49 45 +41x38: 39 44 42 40 39 34 +36x44: 40 58 35 38 35 37 +42x47: 37 25 29 38 47 33 +45x48: 52 53 64 56 55 51 +36x41: 39 37 30 43 40 39 +44x44: 36 48 48 62 48 56 +49x44: 40 35 31 45 34 38 +35x37: 44 37 32 29 26 33 +48x46: 39 31 49 41 43 37 +45x41: 55 45 51 44 43 47 +35x49: 24 35 38 29 24 25 +39x47: 34 35 30 26 36 33 +49x37: 52 50 42 49 41 46 +35x45: 28 31 25 23 31 27 +49x43: 50 63 46 52 64 47 +45x45: 55 50 60 56 45 44 +40x42: 47 48 38 50 37 38 +49x48: 54 68 58 62 59 60 +45x40: 25 32 35 30 33 39 +41x46: 32 36 37 25 29 35 +46x37: 48 42 43 44 47 37 +38x37: 32 33 37 32 51 29 +43x50: 35 44 31 34 32 47 +43x35: 23 27 25 25 26 27 +46x39: 32 41 34 29 28 30 +42x38: 37 43 35 42 46 43 +49x46: 31 34 48 43 45 39 +45x44: 41 59 45 53 56 49 +36x50: 35 28 25 32 35 36 +43x46: 46 50 45 58 54 51 +49x47: 36 34 39 50 35 45 +48x44: 55 46 54 56 61 53 +48x36: 49 44 46 41 42 45 +43x48: 39 36 37 38 31 42 +50x38: 50 61 41 39 50 53 +50x45: 38 45 32 46 47 31 +47x37: 41 51 33 45 48 51 +37x37: 21 21 18 31 31 22 +38x50: 43 60 59 44 41 43 +38x45: 38 27 20 32 34 28 +44x37: 45 43 46 42 37 37 +42x40: 30 29 27 30 28 37 +48x45: 45 56 56 57 52 69 +49x38: 32 21 33 33 46 26 +37x46: 27 31 30 34 29 29 +48x48: 49 62 58 68 53 65 +42x49: 47 55 59 48 59 46 +48x47: 56 51 72 56 55 57 +48x37: 43 46 38 49 50 48 +43x46: 40 34 36 36 34 30 +41x37: 18 34 24 30 24 26 +42x43: 40 42 59 45 41 52 +38x43: 40 40 40 39 49 44 +45x35: 35 27 35 47 59 38 +44x42: 30 32 31 40 31 31 +38x40: 21 28 26 24 24 33 +47x50: 59 60 76 51 55 61 +44x47: 54 45 60 54 51 55 +35x50: 30 30 26 25 32 32 +37x42: 44 46 32 34 41 44 +37x42: 37 29 46 46 44 36 +49x40: 52 51 58 33 53 57 +37x40: 37 22 28 16 29 23 +41x48: 37 39 35 38 32 27 +36x42: 18 32 21 41 29 27 +48x49: 38 33 43 39 54 49 +45x43: 64 51 45 48 42 50 +36x38: 26 46 38 41 30 26 +39x50: 60 41 52 59 44 44 +39x41: 41 46 37 44 40 37 +39x41: 38 41 37 38 45 49 +43x45: 36 36 35 32 42 29 +39x44: 42 41 38 51 40 55 +40x50: 53 56 55 50 51 40 +47x40: 50 55 39 51 49 45 +40x35: 30 26 43 33 49 33 +37x49: 51 46 50 43 41 50 +42x43: 38 36 32 35 31 24 +40x44: 31 26 28 23 37 36 +48x50: 44 37 39 37 56 43 +37x40: 36 33 44 35 41 39 +49x48: 48 46 40 36 38 47 +37x36: 26 20 11 33 25 29 +47x42: 55 46 49 63 50 38 +38x47: 37 54 41 48 53 39 +44x49: 36 28 36 43 37 44 +49x49: 42 47 39 41 50 37 +46x47: 47 62 57 56 53 57 +50x35: 33 25 24 34 31 29 +50x42: 36 45 35 29 52 27 +44x40: 44 52 40 44 43 49 +42x44: 53 49 47 45 43 49 +49x45: 58 54 47 74 47 61 +48x40: 37 39 55 57 57 49 +49x42: 33 34 31 43 34 48 +44x37: 40 43 46 48 35 37 +38x43: 27 28 32 24 28 29 +45x42: 44 24 35 34 39 34 +48x40: 40 49 64 50 43 48 +39x47: 32 32 30 40 33 28 +37x44: 41 38 45 50 36 40 +43x46: 50 58 37 68 49 39 +49x45: 60 64 49 66 49 50 +44x41: 36 28 32 32 25 28 +40x47: 49 49 45 47 55 43 +47x36: 22 33 31 39 30 25 +47x39: 46 50 42 42 53 50 +39x41: 34 31 26 19 27 32 +49x41: 50 47 44 57 57 55 +47x38: 42 41 48 47 49 48 +41x38: 31 37 40 44 49 37 +49x50: 56 54 65 77 62 62 +50x37: 55 39 43 63 39 47 +40x49: 37 49 31 26 29 36 +43x36: 39 46 40 32 48 31 +39x45: 42 49 46 43 50 38 +40x48: 33 38 35 32 37 33 +49x39: 59 47 46 50 44 50 +39x47: 38 26 38 39 33 21 +43x35: 42 33 39 34 42 44 +45x47: 67 44 50 46 63 59 +37x44: 32 34 18 28 29 27 +46x49: 64 55 57 51 68 51 +40x48: 44 49 52 40 51 63 +44x45: 62 37 64 46 43 56 +36x47: 47 41 41 46 40 47 +42x35: 43 37 29 32 42 47 +35x35: 33 31 34 31 34 24 +41x44: 39 56 52 40 51 36 +42x43: 43 45 52 48 45 44 +42x46: 34 43 38 26 36 32 +44x40: 58 44 45 40 43 42 +41x43: 35 34 27 23 34 28 +48x47: 39 43 40 44 35 39 +44x49: 32 38 38 38 48 29 +37x37: 23 26 25 22 20 27 +35x37: 29 29 35 34 33 41 +35x48: 28 29 27 29 31 31 +43x38: 61 42 37 41 30 44 +44x35: 39 49 39 34 39 36 +46x35: 28 26 31 32 26 22 +36x47: 32 34 22 30 32 30 +35x50: 42 56 47 56 31 34 +38x45: 47 38 45 53 34 48 +36x42: 21 35 30 29 22 30 +50x37: 36 35 31 35 30 24 +39x47: 21 31 35 40 32 36 +38x49: 33 29 34 31 29 35 +40x40: 35 28 26 27 28 25 +45x46: 57 48 64 38 58 55 +39x40: 37 41 38 36 45 44 +36x37: 19 24 34 23 20 23 +40x46: 44 46 56 51 43 41 +46x45: 47 69 41 60 57 40 +47x46: 34 43 38 34 33 42 +37x42: 23 51 41 37 40 47 +37x41: 46 44 37 34 32 43 +42x50: 55 55 54 57 50 52 +42x42: 30 26 23 29 43 45 +44x44: 37 53 53 47 60 45 +37x50: 54 43 71 31 47 37 +45x49: 57 57 55 52 58 62 +50x48: 64 61 68 53 67 55 +46x46: 58 59 39 51 61 60 +36x43: 22 26 27 37 31 25 +45x37: 24 36 30 32 37 20 +44x43: 54 55 45 43 44 52 +45x46: 32 40 38 37 41 37 +38x48: 49 36 51 48 43 57 +36x45: 32 30 31 32 26 28 +44x38: 32 27 29 27 25 28 +35x46: 32 30 18 25 27 32 +46x40: 28 30 32 30 44 31 +49x41: 37 35 41 23 27 44 +43x38: 29 33 28 31 23 24 +47x41: 53 55 52 47 44 45 +35x50: 23 27 31 34 24 37 +47x49: 72 45 69 59 46 68 +42x50: 31 43 39 30 39 41 +41x40: 33 25 29 27 24 31 +40x36: 31 47 37 31 35 41 +44x40: 34 30 34 33 27 24 +36x47: 37 41 40 53 47 41 +42x40: 52 39 49 42 33 46 +35x44: 32 44 45 47 32 35 +41x36: 32 42 46 35 42 26 +42x36: 47 38 44 27 45 31 +42x39: 51 46 41 38 47 26 +35x38: 22 41 29 41 34 37 +45x41: 46 55 45 51 37 51 +41x45: 32 30 26 43 36 28 +48x44: 52 53 48 55 53 68 +36x36: 32 28 41 30 26 46 +48x49: 68 56 63 49 68 59 +50x50: 61 61 67 63 69 63 +35x48: 44 43 47 49 37 37 +37x49: 42 55 39 50 48 44 +40x50: 35 25 35 33 37 43 +45x35: 46 43 43 32 42 36 +42x41: 24 25 32 34 31 36 +48x46: 42 35 53 34 39 37 +41x40: 26 36 16 31 27 32 +48x38: 48 42 46 50 49 46 +39x39: 21 25 38 27 22 35 +38x40: 41 50 34 32 42 34 +39x37: 40 38 45 30 32 38 +46x38: 28 24 34 32 35 27 +44x43: 43 40 54 45 64 43 +39x49: 53 41 50 59 47 43 +36x44: 21 28 30 30 27 31 +46x39: 47 52 40 51 49 34 +37x43: 43 54 37 38 34 39 +47x48: 55 61 69 59 53 47 +50x41: 34 27 34 36 38 38 +43x45: 47 52 53 47 53 44 +36x43: 41 36 35 43 36 51 +36x47: 36 29 26 33 22 33 +44x48: 53 54 62 52 53 50 +48x50: 46 41 31 45 47 46 +41x50: 33 39 30 41 39 26 +48x42: 50 54 56 46 56 47 +41x48: 34 38 33 30 41 31 +40x42: 50 39 46 42 39 44 +50x35: 45 44 37 50 45 50 +35x44: 39 36 41 44 46 28 +36x36: 19 32 29 16 17 30 +36x37: 42 26 44 30 34 29 +47x40: 33 23 26 39 35 39 +49x48: 73 65 50 53 65 57 +41x37: 23 32 22 24 23 32 +48x38: 52 47 52 52 39 37 +39x44: 31 38 30 28 24 31 +43x50: 56 62 54 54 60 41 +46x40: 17 34 41 35 33 34 +44x46: 61 52 38 60 55 45 +44x44: 32 31 40 32 27 34 +46x35: 33 30 29 31 14 28 +44x48: 62 46 56 46 53 67 +50x37: 47 52 38 51 51 45 +39x35: 27 17 22 31 20 25 +43x45: 51 57 52 50 47 38 +38x36: 40 35 33 34 35 34 +37x38: 16 26 23 21 34 24 +49x39: 43 60 46 48 38 62 +46x35: 45 44 34 37 49 39 +37x44: 30 26 30 31 28 23 +43x45: 49 50 56 39 54 50 +46x35: 50 44 39 33 47 34 +43x36: 24 35 27 23 35 23 +46x43: 39 33 34 34 33 37 +45x45: 33 42 37 37 49 27 +50x43: 64 54 53 58 44 61 +44x36: 27 27 32 21 30 31 +44x35: 28 27 27 26 22 24 +48x39: 44 45 49 46 60 42 +48x43: 44 60 64 56 49 40 +36x40: 26 21 27 35 16 31 +41x50: 54 55 57 58 39 53 +49x35: 48 47 38 44 41 48 +38x45: 38 40 42 58 40 45 +49x47: 30 55 42 35 40 37 +50x43: 51 60 52 60 43 68 +46x35: 38 25 32 22 19 28 +50x43: 57 43 60 49 56 71 +45x40: 32 30 29 37 26 40 +41x46: 24 37 27 34 35 37 +50x45: 67 57 52 52 67 51 +47x42: 30 32 40 39 35 33 +44x44: 44 63 51 46 40 55 +43x38: 34 38 22 29 21 23 +42x39: 31 30 28 37 25 30 +35x49: 45 53 41 49 36 39 +36x40: 22 32 30 26 21 24 +43x44: 36 33 28 26 42 31 +48x45: 53 65 45 51 53 69 +37x47: 48 43 53 40 43 40 +46x50: 55 60 66 55 58 60 +42x42: 29 35 31 36 34 30 +40x42: 51 35 44 43 41 47 +42x48: 38 55 58 42 60 57 +41x37: 45 40 29 37 38 48 +42x44: 43 47 46 57 48 41 +50x43: 53 52 46 62 64 53 +48x35: 38 39 47 41 50 43 +40x43: 37 34 29 21 24 37 +37x40: 24 26 27 36 18 25 +47x42: 39 35 26 34 39 37 +48x44: 62 68 58 47 43 46 +35x40: 23 23 19 29 22 26 +48x40: 29 36 44 30 38 31 +36x42: 32 33 28 24 31 19 +48x45: 54 52 61 53 63 47 +41x41: 45 51 37 39 39 50 +44x40: 24 36 36 31 31 23 +35x45: 28 23 21 36 28 29 +42x47: 51 63 42 49 48 51 +40x46: 52 42 52 43 51 43 +35x35: 12 25 16 20 24 23 +37x41: 27 24 24 26 30 24 +43x47: 49 54 57 51 42 60 +43x49: 55 54 55 58 50 52 +44x42: 48 38 53 48 52 45 +46x47: 51 57 58 42 59 69 +45x36: 33 47 38 44 43 44 +40x42: 47 46 41 50 36 38 +44x36: 24 35 26 28 30 24 +36x42: 44 47 36 36 34 36 +39x37: 25 28 26 19 26 31 +41x40: 41 41 44 49 34 44 +47x36: 22 33 35 28 31 31 +47x35: 46 35 51 35 37 53 +46x35: 42 46 44 51 32 30 +38x37: 39 41 31 37 33 36 +36x35: 32 28 34 28 42 29 +44x44: 49 48 43 54 50 56 +37x42: 39 38 49 40 37 35 +44x44: 46 55 41 50 53 54 +45x48: 41 41 38 38 49 33 +48x40: 44 44 50 52 56 49 +42x45: 47 32 31 37 36 27 +42x43: 44 48 41 42 51 54 +50x48: 42 46 44 39 44 40 +47x49: 44 35 38 55 33 34 +47x41: 48 49 47 42 50 65 +45x36: 25 32 33 28 28 33 +36x38: 25 25 26 22 15 30 +47x41: 42 45 41 54 59 57 +45x37: 43 47 49 34 42 41 +42x40: 47 44 30 55 39 45 +47x39: 50 49 40 50 48 45 +48x42: 36 36 40 29 41 41 +39x43: 48 46 42 39 44 39 +42x35: 41 31 41 40 39 34 +45x43: 35 28 34 44 36 32 +40x42: 40 19 32 33 28 29 +37x38: 36 39 29 36 35 44 +39x42: 39 57 40 38 38 39 +44x42: 38 61 48 51 38 47 +39x47: 40 33 27 37 30 28 +35x46: 18 33 31 29 29 25 +41x36: 34 39 41 35 47 28 +47x43: 42 34 32 32 31 38 +44x45: 40 33 31 37 31 38 +50x37: 26 38 25 32 35 35 +48x50: 54 60 56 73 62 64 +42x41: 37 18 34 25 25 42 +40x42: 50 35 35 37 52 54 +36x36: 30 31 22 21 20 19 +44x37: 43 43 37 39 44 46 +42x36: 45 26 41 44 36 43 +43x49: 38 37 36 24 36 52 +36x48: 45 35 55 49 44 36 +35x37: 33 31 38 25 38 35 +45x38: 37 34 27 25 30 26 +46x40: 33 41 35 27 33 25 +39x44: 38 38 50 43 49 46 +40x36: 39 39 32 40 41 29 +46x35: 43 43 39 48 40 33 +46x44: 34 35 33 27 40 40 +39x46: 36 34 29 35 29 31 +49x42: 44 33 33 38 36 40 +36x40: 39 34 37 44 32 36 +45x43: 38 36 37 32 42 25 +36x50: 49 45 46 39 47 54 +48x50: 56 71 61 63 56 62 +41x41: 39 51 32 40 57 38 +43x35: 27 18 29 29 25 26 +37x39: 37 29 34 51 35 36 +49x44: 46 59 50 69 50 57 +45x46: 28 41 35 26 50 44 +49x48: 39 43 50 37 40 47 +46x45: 33 43 34 50 33 31 +48x40: 67 39 47 45 54 45 +41x36: 38 38 35 42 40 33 +41x39: 43 33 43 46 40 42 +47x47: 55 67 50 58 56 53 +49x42: 60 53 56 47 59 39 +46x50: 56 56 56 72 64 46 +36x48: 44 51 33 47 50 40 +47x41: 40 49 60 42 51 55 +49x40: 34 55 24 35 24 36 +45x50: 60 57 63 63 56 44 +46x35: 55 37 48 36 38 34 +49x43: 48 32 31 38 44 30 +49x43: 50 56 50 55 43 76 +35x35: 33 22 36 38 26 35 +43x47: 37 32 35 36 37 32 +50x42: 54 57 56 47 51 60 +45x45: 58 49 51 54 58 39 +48x37: 34 39 28 38 33 20 +41x45: 41 51 48 44 55 43 +35x41: 43 31 40 33 35 41 +38x41: 21 30 32 18 27 27 +36x49: 26 23 38 27 46 31 +49x37: 42 52 43 46 45 52 +37x39: 27 29 48 38 36 45 +39x37: 37 50 36 31 35 32 +46x44: 62 58 57 52 40 41 +40x45: 41 46 42 52 48 48 +50x47: 63 70 59 52 53 67 +47x48: 39 40 50 34 37 39 +42x41: 23 26 35 42 27 29 +40x50: 51 60 54 40 44 62 +43x47: 31 41 28 29 44 37 +48x50: 70 53 59 67 62 59 +39x45: 47 45 47 40 51 39 +44x37: 30 31 22 29 27 28 +43x49: 45 52 56 66 48 57 +44x45: 26 43 31 44 35 31 +42x44: 43 45 50 42 59 44 +45x37: 50 38 42 40 44 44 +42x44: 29 42 23 37 39 25 +38x46: 44 42 49 44 46 44 +46x49: 50 60 50 62 59 68 +40x49: 20 29 39 47 33 39 +50x40: 51 46 67 48 49 45 +45x39: 41 44 45 51 45 43 +45x45: 65 53 53 40 50 53 +47x50: 52 59 59 73 61 55 +38x35: 15 21 26 25 28 17 +46x36: 31 32 34 25 27 31 +47x49: 41 44 37 38 48 31 +36x42: 26 35 44 46 37 45 +37x49: 43 47 57 39 50 41 +44x50: 52 61 53 63 55 53 +40x44: 38 41 46 53 47 45 +40x50: 57 47 56 49 50 49 +45x35: 50 50 37 45 27 33 +50x40: 65 52 55 50 37 51 +38x43: 43 43 36 48 35 49 +46x46: 64 56 65 48 40 54 +40x37: 28 22 29 21 28 28 +44x50: 69 59 58 41 54 61 +44x50: 40 32 41 35 39 37 +41x50: 28 39 26 36 31 47 +46x40: 42 25 29 30 36 32 +36x43: 21 31 28 30 33 24 +49x35: 23 32 29 27 34 31 +36x44: 25 25 30 30 40 17 +42x49: 54 59 49 59 46 49 +49x43: 53 56 55 61 49 49 +37x44: 46 43 41 37 41 44 +39x47: 48 41 43 52 40 63 +46x39: 33 38 41 23 33 26 +45x38: 30 50 45 44 44 50 +41x42: 40 35 49 52 46 42 +47x38: 43 50 46 46 45 44 +41x36: 44 34 39 43 31 37 +47x42: 37 34 33 29 39 38 +44x50: 32 39 34 41 43 34 +45x40: 35 30 33 30 38 29 +44x43: 44 34 28 21 37 31 +46x49: 45 27 41 40 37 50 +37x48: 36 44 53 51 41 48 +50x50: 55 61 73 58 69 69 +48x44: 48 63 54 57 44 60 +39x47: 28 54 51 42 52 55 +39x43: 44 35 46 44 40 52 +50x45: 53 40 39 37 37 34 +36x49: 28 26 27 28 48 35 +47x41: 33 34 29 40 21 38 +35x40: 33 34 26 40 44 39 +35x42: 27 27 21 21 30 28 +48x42: 33 41 40 34 36 40 +42x43: 38 30 30 37 28 32 +36x36: 30 33 42 33 28 33 +39x41: 30 33 48 44 50 39 +46x46: 37 66 48 59 48 70 +45x40: 31 32 37 27 34 33 +40x40: 41 42 39 47 38 39 +43x41: 59 48 36 44 40 47 +50x42: 41 32 40 36 39 36 +39x35: 48 37 38 26 28 35 +43x49: 54 45 60 50 58 59 +42x37: 34 20 25 24 30 34 +49x41: 42 31 35 28 43 29 +48x43: 48 56 53 61 51 46 +38x36: 29 18 22 30 22 22 +46x38: 36 28 32 24 38 22 +37x47: 57 44 45 41 40 42 +50x45: 57 62 45 50 71 63 +41x38: 37 46 33 36 39 52 +37x49: 32 30 37 33 28 31 +44x42: 46 63 61 37 36 39 +42x50: 35 29 39 36 36 49 +38x49: 31 33 30 30 35 32 +45x40: 25 31 34 31 38 35 +44x47: 40 30 32 37 31 40 +40x39: 35 46 42 38 38 41 +38x48: 39 29 26 34 32 31 +47x50: 62 63 66 55 63 50 +40x41: 45 43 45 36 37 49 +49x37: 29 26 40 22 42 32 +46x43: 30 31 30 37 49 32 +35x50: 47 45 45 42 45 46 +41x47: 40 51 54 49 50 52 +45x43: 52 54 58 41 49 42 +45x48: 45 60 50 61 47 73 +41x35: 23 32 20 24 19 25 +45x36: 55 41 46 33 36 40 +48x37: 50 39 52 37 41 59 +45x46: 61 51 58 57 37 57 +50x45: 54 46 60 64 56 69 +50x39: 39 32 33 29 38 37 +43x35: 24 22 20 30 21 36 +40x42: 23 36 26 33 42 22 +44x39: 44 40 44 42 49 46 +50x38: 48 48 51 47 49 50 +48x43: 49 74 49 47 46 52 +49x43: 54 52 51 52 52 67 +43x36: 43 39 46 35 39 36 +36x40: 43 30 41 32 46 28 +43x43: 40 55 49 42 52 45 +38x49: 28 32 44 31 30 27 +41x37: 43 41 33 31 43 45 +46x43: 43 31 40 25 42 29 +48x43: 26 42 24 60 32 39 +43x43: 36 24 31 40 31 34 +44x36: 36 42 47 39 39 40 +38x41: 23 26 25 24 27 31 +48x40: 40 53 53 53 49 45 +47x49: 43 28 47 35 46 40 +36x41: 47 40 37 37 34 32 +46x41: 33 31 30 33 34 34 +50x47: 59 61 48 63 70 61 +49x37: 44 54 41 49 47 43 +50x47: 48 34 37 46 42 33 +45x50: 34 45 45 45 39 32 +37x47: 35 47 34 48 57 46 +49x36: 47 44 48 38 47 49 +46x44: 48 63 53 44 44 62 +36x46: 48 45 38 36 41 50 +36x39: 33 36 45 30 36 36 +45x46: 47 55 47 60 56 53 +45x35: 47 36 44 33 37 49 +37x44: 20 23 29 28 29 38 +45x36: 37 25 32 22 31 33 +45x43: 41 34 55 62 47 61 +43x36: 41 43 37 44 38 34 +37x39: 33 27 24 28 18 25 diff --git a/Cargo.lock b/Cargo.lock index 1ab52f9..e6e29ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,309 +5,3 @@ version = 4 [[package]] name = "aoc-2025" version = "0.1.0" -dependencies = [ - "nalgebra", -] - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "bytemuck" -version = "1.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" - -[[package]] -name = "glam" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "333928d5eb103c5d4050533cec0384302db6be8ef7d3cebd30ec6a35350353da" - -[[package]] -name = "glam" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abb554f8ee44336b72d522e0a7fe86a29e09f839a36022fa869a7dfe941a54b" - -[[package]] -name = "glam" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4126c0479ccf7e8664c36a2d719f5f2c140fbb4f9090008098d2c291fa5b3f16" - -[[package]] -name = "glam" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01732b97afd8508eee3333a541b9f7610f454bb818669e66e90f5f57c93a776" - -[[package]] -name = "glam" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525a3e490ba77b8e326fb67d4b44b4bd2f920f44d4cc73ccec50adc68e3bee34" - -[[package]] -name = "glam" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8509e6791516e81c1a630d0bd7fbac36d2fa8712a9da8662e716b52d5051ca" - -[[package]] -name = "glam" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" - -[[package]] -name = "glam" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" - -[[package]] -name = "glam" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" - -[[package]] -name = "glam" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c" - -[[package]] -name = "glam" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" - -[[package]] -name = "glam" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" - -[[package]] -name = "glam" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" - -[[package]] -name = "glam" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" - -[[package]] -name = "glam" -version = "0.29.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee" - -[[package]] -name = "glam" -version = "0.30.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd47b05dddf0005d850e5644cae7f2b14ac3df487979dbfff3b56f20b1a6ae46" - -[[package]] -name = "matrixmultiply" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "nalgebra" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5b3eff5cd580f93da45e64715e8c20a3996342f1e466599cf7a267a0c2f5f" -dependencies = [ - "approx", - "glam 0.14.0", - "glam 0.15.2", - "glam 0.16.0", - "glam 0.17.3", - "glam 0.18.0", - "glam 0.19.0", - "glam 0.20.5", - "glam 0.21.3", - "glam 0.22.0", - "glam 0.23.0", - "glam 0.24.2", - "glam 0.25.0", - "glam 0.27.0", - "glam 0.28.0", - "glam 0.29.3", - "glam 0.30.9", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973e7178a678cfd059ccec50887658d482ce16b0aa9da3888ddeab5cd5eb4889" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "proc-macro2" -version = "1.0.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "safe_arch" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "simba" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - -[[package]] -name = "syn" -version = "2.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "typenum" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" - -[[package]] -name = "unicode-ident" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" - -[[package]] -name = "wide" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" -dependencies = [ - "bytemuck", - "safe_arch", -] diff --git a/Cargo.toml b/Cargo.toml index 88d9c4d..16aaec5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2024" [dependencies] -nalgebra = "0.34.1" [[bin]] name = "1-secret-entrance" @@ -48,4 +47,8 @@ path = "src/10-factory.rs" [[bin]] name = "11-reactor" -path = "src/11-reactor.rs" \ No newline at end of file +path = "src/11-reactor.rs" + +[[bin]] +name = "12-christmas-tree-farm" +path = "src/12-christmas-tree-farm.rs" \ No newline at end of file diff --git a/src/10-factory.rs b/src/10-factory.rs index 987d715..a104251 100644 --- a/src/10-factory.rs +++ b/src/10-factory.rs @@ -3,7 +3,6 @@ use std::fs::File; use std::io::{self, BufRead, BufReader}; use std::str::FromStr; use std::u64; -use nalgebra::{DMatrix, DVector}; #[derive(Debug)] struct Machine { diff --git a/src/12-christmas-tree-farm.rs b/src/12-christmas-tree-farm.rs new file mode 100644 index 0000000..51b9282 --- /dev/null +++ b/src/12-christmas-tree-farm.rs @@ -0,0 +1,118 @@ +use std::{fs::File, io::{self, BufRead, BufReader}, str::FromStr}; + +struct Piece { + cells: Vec> +} + +impl FromStr for Piece { + type Err = (); + + fn from_str(s: &str) -> Result { + let cells: Vec<_> = + s.split('\n').map(|row| { + row.chars().fold(Vec::new(), |mut state, c| { + match c { + '#' => state.push(true), + '.' => state.push(false), + _ => () + }; + state + }) + }) + .collect(); + Ok(Piece { cells: cells }) + } +} + +impl Piece { + fn bounds_area(&self) -> u64 { + let height = self.cells.len(); + if height > 0 { + (self.cells[0].len() * height) as u64 + } else { + 0 + } + } + + fn true_area(&self) -> u64 { + self.cells.iter() + .flatten() + .map(|&b| if b { 1 } else { 0 }) + .sum() + } +} + +struct Region { + width: u64, + height: u64, + requirements: Vec +} + +impl FromStr for Region { + type Err = (); + + fn from_str(s: &str) -> Result { + let (area_str, requirements_str) = s.split_once(':').unwrap(); + let (width_str, height_str) = area_str.split_once('x').unwrap(); + let width = width_str.parse::().unwrap(); + let height = height_str.parse::().unwrap(); + let requirements: Vec<_> = requirements_str.split(' ') + .fold(Vec::new(), |mut state, count| { + if let Ok(count) = count.parse::() { + state.push(count); + } + state + }); + Ok(Region { width: width, height: height, requirements: requirements }) + } +} + +fn is_solveable(pieces: &[Piece], region: &Region) -> bool { + // Lower area bound = perfectly packed + let region_area = region.width * region.height; + let used_area: u64 = pieces.iter() + .zip(region.requirements.clone()) + .map(|(piece, cnt)| piece.true_area() * cnt) + .sum(); + if used_area > region_area { return false }; + + // Upper area bound = 3x3 pieces + let available_3x3s = region.width / 3 * region.height / 3; + let piece_cnt: u64 = region.requirements.iter().sum(); + if piece_cnt <= available_3x3s { return true }; + + println!("Non-trivial solution"); + false +} + +fn main() -> Result<(), io::Error> { + let f = File::open("12-input.txt")?; + let reader = BufReader::new(f); + + let lines: Vec<_> = reader.lines().collect::>()?; + let (lines_pieces, lines_regions) = lines.split_at(30); + + let pieces: Vec<_> = lines_pieces.chunks(5) + .map(|lines| { + lines[1..lines.len()-1].join("\n").parse::().unwrap() + }) + .collect(); + + let regions: Vec<_> = lines_regions.iter() + .map(|line| { + line.parse::().unwrap() + }) + .collect(); + + let result = regions.iter() + .map(|region| { + if is_solveable(&pieces, region) { + 1 + } else { + 0 + } + }) + .sum::(); + println!("Result: {}", result); + Ok(()) +} \ No newline at end of file