#C1030. Greatest Common Divisor
Greatest Common Divisor
Greatest Common Divisor
In this problem, you are given multiple pairs of integers, and your task is to compute the greatest common divisor (GCD) for each pair. The greatest common divisor of two integers (a) and (b), denoted as (\gcd(a, b)), is the largest integer that divides both (a) and (b) without leaving a remainder.
You are required to implement a solution that reads from standard input and writes to standard output. The input begins with an integer (T) specifying the number of test cases, followed by (T) lines each containing two space-separated integers. For each test case, output the GCD of the provided integers on a new line.
inputFormat
The first line contains a single integer (T) ((1 \leq T \leq 10^5)) representing the number of test cases. Each of the next (T) lines contains two integers (a) and (b) ((1 \leq a, b \leq 10^{12})) separated by a space.
outputFormat
For each test case, output a single line containing the greatest common divisor of (a) and (b).## sample
3
15 25
18 24
7 19
5
6
1
</p>