Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nwd(a, b):
- while b:
- a, b = b, a%b
- return a
- t = input()
- t = int(t)
- for i in range(t):
- ab = input()
- a,b = ab.split()
- a = int(a)
- b = int(b)
- c = a*b/nwd(a,b)
- print(int(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement