fork download
  1. T = int(input())
  2. answer = []
  3. for i in range(T):
  4. C = []
  5. a,b = map(int, input().split())
  6. for i in range(2,max(a,b)+1):
  7. if a % i == 0 and b % i == 0:
  8. C.append(i)
  9. D = C[len(C)-1]
  10. answer.append((a// D)*(b//D)*(D))
  11. for _ in answer:
  12. print(_)
  13.  
Runtime error #stdin #stdout #stderr 0.16s 25308KB
stdin
1
1 1
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 9, in <module>
IndexError: list index out of range