Submit | All submissions | Best solutions | Back to list |
G_C_DIVI - Greatest common divisor |
Wersja polska | English version |
For given integers a and b print the greatest common divisor of a and b.
Input
The first line of the standard input contains one integer t (t<10001) which is the number of test cases.
In each of the next t lines there are two numbers: a and b.
Output
For each test, print the greatest common divisor of a and b.
Example
Input:
3
5 5
7 5
128 164
Output:
5
1
4
Added by: | Piotr KÄ…kol |
Date: | 2010-01-12 |
Time limit: | 6.466s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS OBJC SCM qobi VB.NET |