···66from collections import Counter # NOQA
77from itertools import product, permutations, combinations, combinations_with_replacement # NOQA
8899-from utils import parse_line, mul, factors, memoize, primes, Point # NOQA
99+from utils import parse_line, mul, factors, memoize, primes, new_table, Point # NOQA
10101111# Itertools Functions:
1212# product('ABCD', repeat=2) AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD
···16161717total = 0
1818result = []
1919+table = new_table(None, width=2, height=4)
19202021for i, line in enumerate(fileinput.input()):
2122 line = line.strip()
+4
2016/utils.py
···2020 return ret
212122222323+def new_table(val, width, height):
2424+ return [[val for _ in range(width)] for _ in range(height)]
2525+2626+2327def mul(lst):
2428 """Like sum(), but for multiplication."""
2529 return reduce(operator.mul, lst, 1) # NOQA