NINJA3 - STUNNING GCD
You are given three numbers N, a, b. You can build a number X by repeating N 'a' times and the number Y by repeating N 'b' times. Now that you have the numbers X and Y, determine the GCD of the two numbers X and Y.
The first line contains an integer T, the number of test cases.
Then for each test case, there are three integers in each line: N, a, b.
Print the required answer for each test case in a single line.
1 <= T <= 100
1 <= N, a, b <= 10 ^ 18
123 2 3
easy 1 :)) AC in 1 go...
GOod Problem observe :)
idk why am i getting a run time error(NZEC) on python i am getting absolutely correct answers when i execute it on an IDE
My 50th ..easy Ac at one go
Just because the introduction is not clear: lets say you have this case: 3 4 8
After a long a problem in one Go.....
pure maths.Last edit: 2017-06-29 15:55:13
@akshayvenkat...tnx dude...till now, had got the qus wrong :P
Simple one AC in 1 go:-)
ya i totally agree with coder_hsnake