
ZOJ Problem Set  3458
Give you two positive integers a and b, which satisfies 0 < ba < 1+2sqrt(a), together with a positive even number n, please calculate the value of floor((sqrt(a)+sqrt(b))^n) % 2(a+b). InputThere are multiple test cases. Each test case include three integers a, b and n (1 <= a <= 10000, 1 <= b <= 10000, 2 <= n <= 10^9). OutputFor each test case, output an single line contains the value of the formula described above. Sample Input21 29 1998 Sample Output99 Author: JIANG, Kai Contest: ZOJ Monthly, January 2011 