#Python code to find GCD of two very large numbers
for i in range(input()):
a,b = [long(i) for i in raw_input().split()]
while b :
a,b = b,long(a%b)
print a
for i in range(input()):
a,b = [long(i) for i in raw_input().split()]
while b :
a,b = b,long(a%b)
print a
No comments:
Post a Comment