Given three integers N, x and y, a number A is formed by repeating N x times and another number B is formed by repeating N y times. You need to find the GCD(A,B).
The first line of input contains of an integer 'T' denoting number of test cases.Only line of each test case contains three integers N,x and y .
For each case print an integer corresponding to the answer .
1 <= T <= 100
1 <= N,x,y <= 1018
1 1 1
2 2 3
For 2nd test case
A=22 B=222 gcd(A,B)=2
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.