diff --git a/solutions/src/2024/13.hs b/solutions/src/2024/13.hs index 9631171..f6838d4 100644 --- a/solutions/src/2024/13.hs +++ b/solutions/src/2024/13.hs @@ -49,7 +49,7 @@ main = cost :: Integer -> (Integer, Integer, Integer, Integer, Integer, Integer) -> Integer cost extra (ax, ay, bx, by, x, y) - | det == 0 = colinear ax ay bx by x y + | det == 0 = colinear ax ay bx by x' y' | (a, 0) <- (by * x' - bx * y') `quotRem` det, a >= 0 , (b, 0) <- (ax * y' - ay * x') `quotRem` det, b >= 0 = 3 * a + b