NINJA3  STUNNING GCD
Problem statement:
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.
Input format:
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.
Output format:
Print the required answer for each test case in a single line.
Constraints:
1 <= T <= 100
1 <= N, a, b <= 10 ^ 18
Sample input:
1
123 2 3
Output:
123
hide comments
sanyam19:
20180111 17:02:57
easy 1 :)) AC in 1 go... 

ayushgupta1997:
20171225 18:38:50
GOod Problem observe :) 

satyam_lal:
20171223 18:48:09
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 

shub1025:
20171215 05:53:26
My 50th ..easy Ac at one go 

Rafail Loizou:
20170817 01:31:52
Just because the introduction is not clear: lets say you have this case: 3 4 8


namitp:
20170730 16:01:22
After a long a problem in one Go.....


rohit9934:
20170629 15:53:26
pure maths. Last edit: 20170629 15:55:13 

harshahj97:
20170128 18:00:16
@akshayvenkat...tnx dude...till now, had got the qus wrong :P


vengatesh15:
20170120 15:24:46
Simple one AC in 1 go:) 

agarwalg271:
20160816 11:55:39
ya i totally agree with coder_hsnake

Added by:  mombassa 
Date:  20160217 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 