Gấp hạc:
from math import gcd
t = int(input())
for i in range(0,t):
a,b = map(int,input().split())
print(a*b//gcd(a,b)**2)
Số thân thiện
from math import gcd
def check(n):
k = n
s = 0
while n!=0:
s = s*10 + n%10
n //= 10
return gcd(s,k)==1
t = int(input())
for i in range(0,t):
n = int(input())
if check(n):
print("YES")
else:
print("NO")