백준 [1934] 최소공배수
n = int(input())
for i in range(n):
num = input()
num = num.split()
num = list(map(int, num))
if (num[0] > num[1]):
mid = num[1]
else:
mid = num[0]
for j in range(mid, 0, -1):
if (num[0] % j == 0 and num[1] % j == 0):
leastnum = j*(num[0] // j)*(num[1] // j)
break
print(leastnum)