https://www.acmicpc.net/problem/5347
def myGdc(a, b):
while b>0:
a, b=b, a%b
return a
n=int(input())
for i in range(n):
a, b=map(int, input().split())
x=myGdc(a, b)
print((a*b)//x)
def gdc(a, b):
while b>0: #b๊ฐ 0์ด ๋ ๋๊น์ง ๋ฐ๋ณต
a, b=b, a%b
return a