/ Python / 2015 / 25.py
25.py
1  from lib import *
2  
3  input = read_input(2015, 25)
4  
5  row, col = map(int, re.match(r"^.*?(\d+).*?(\d+).*?$", input).groups())
6  
7  
8  n = row + col - 2
9  print((20151125 * pow(252533, n * (n + 1) // 2 + 1 + col - 2, 33554393)) % 33554393)