a = int(input()) for i in range(a): b = input().split() c = b[0] d = b[1] n1, n2 = c, d while c > 0: r = c%d d = c c = r gcd = d lcm = (n1*n2)//gcd print(gcd) print(lcm)
c = int(b[0]) d = int(b[1])
a = input().split() n1 = int(a[0]) n2 = int(a[1]) c = n1 d = n2 while c != 0: r = c c = d % c d = r gcd = d lcm = (n1*n2)//gcd print(gcd) print(lcm)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)