fork download
  1. def nwd (n, k):
  2. x=0
  3. while k != 0:
  4. x= n%k
  5. n,k = k , x
  6. return n
  7. t=int(input())
  8. for i in range(t):
  9. n=int(input())
  10. linijka= input().split()
  11. for j in range(n):
  12. linijka[j]= int(linijka[j])
  13. nww=1
  14. for j in range(n):
  15. nww=nww*linijka[j]//nwd(linijka[j], nww)
  16. print(nww)
Success #stdin #stdout 0.04s 9696KB
stdin
2
3
2 3 5
3
6 9 15
stdout
30
90