def nwd (n, k):
x=0
while k != 0:
x= n%k
n,k = k , x
return n
t=int(input())
for i in range(t):
n=int(input())
linijka= input().split()
for j in range(n):
linijka[j]= int(linijka[j])
nww=1
for j in range(n):
nww=nww*linijka[j]//nwd(linijka[j], nww)
print(nww)
ZGVmIG53ZCAobiwgayk6Cgl4PTAKCXdoaWxlIGsgIT0gMDoKCQl4PSBuJWsKCQluLGsgPSBrICwgeAoJcmV0dXJuIG4KdD1pbnQoaW5wdXQoKSkKZm9yIGkgaW4gcmFuZ2UodCk6CgluPWludChpbnB1dCgpKQoJbGluaWprYT0gaW5wdXQoKS5zcGxpdCgpCglmb3IgaiBpbiByYW5nZShuKToKCQlsaW5pamthW2pdPSBpbnQobGluaWprYVtqXSkKCW53dz0xCglmb3IgaiBpbiByYW5nZShuKToKCQlud3c9bnd3Kmxpbmlqa2Fbal0vL253ZChsaW5pamthW2pdLCBud3cpCglwcmludChud3cp