题解 | #小强爱数学#
小强爱数学
http://www.nowcoder.com/questionTerminal/3b6dc1447d6d4ac4b9c2d45f1d4637ea
没办法,用python就是会超时,T_T
T = int(input().split()[0]) for _ in range(T): A, B, n = list(map(int, input().split())) a, b, c = A, (A**2 - 2*B) % (1e9+7), 0 if n == 1: print(a) if n == 2: print(b) while n > 2: c = (A*b - B*a)%(1e9+7) # c = A*b % (1e9 + 7) - B*a % (1e9+7) a = b b = c n -= 1 print(int(c))