fork download
  1. T = int(input())
  2.  
  3. gcd = []
  4. for i in range(T):
  5. a,b = map(int, input().split())
  6. ta,tb = a, b
  7. gcd.append([a,b])
  8. if(a>=b):
  9. if(ta%tb==0):
  10. gcd[i].append(tb)
  11. else:
  12. while(tb !=0 ):
  13. r = tb % ta
  14. tb = ta
  15. ta = r
  16. gcd[i].append(tb)
  17. else:
  18. if (tb % ta == 0):
  19. gcd[i].append(ta)
  20. else:
  21. while(tb !=0 ):
  22.  
  23. r = ta%tb
  24. ta = tb
  25. tb = r
  26. gcd[i].append(ta)
  27. for i in range(len(gcd)):
  28. print(int(gcd[i][0] * gcd[i][1] / gcd[i][2]))
Runtime error #stdin #stdout #stderr 0.04s 9460KB
stdin
1
45000 44999
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 13, in <module>
ZeroDivisionError: integer division or modulo by zero