BETA
School Problem's Submission isn't counted in score!

Submissions: 899 Accuracy:

46.38%

GCD of two numbers
     

Given two numbers, find the GCD of those 2 numbers.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains two space separated integers a and b.

Output:
Print the GCD of the two numbers.

Constraints:
1 <= T <= 100
1 <= a , b <= 1000

Example:
Input:

98 56
48 18
Output:
14
6

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.