Maximum GCD
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given integers. You have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.
Input
The first line contains the number of test cases .
The following lines are the test cases. Each test case contains positive integers.
Output
For each test case, print on a separate line the maximum GCD value among all possible pairs of integers.
Examples
Input #1
Answer #1
Note
For the first test case, the answer is GCD(20, 40) = 20.
For the third test case, the answer is GCD(125, 25) = 25.
Submissions 1K
Acceptance rate 49%