GCD with large powers and Modulus

90 Views Asked by At

Given three Values A , B , N

Find GCD ( ( ( A^N) + (B^N) ) , (A-B) )

where A,B,N <= 10^12

For more details : < https://www.codechef.com/AUG18B/problems/GCDMOD/ >