#K7756. GCD of Integer Pairs

    ID: 34891 Type: Default 1000ms 256MiB

GCD of Integer Pairs

GCD of Integer Pairs

You are given T test cases. Each test case contains two integers a and b. Your task is to compute the greatest common divisor (GCD) for each pair.

The GCD of two integers is the largest positive integer that divides both a and b without leaving a remainder. It can be expressed in LaTeX as: \( \gcd(a, b) \).

Input and output are via standard input (stdin) and standard output (stdout), respectively.

inputFormat

The first line contains an integer T, representing the number of test cases. Each of the following T lines contains two space-separated integers a and b.

Constraints:

  • 1 ≤ T ≤ 105
  • 1 ≤ a, b ≤ 109

outputFormat

For each test case, output the GCD of the given pair of integers on a new line.

## sample
3
14 21
35 10
100 25
7

5 25

</p>