#include <stdio.h>
int
getGCD(
int
a,
int
b){
int
temp;
if
(a < b){
temp = a;
a = b;
b = temp;
}
if
(a%b == 0){
return
b;
}
else
{
return
getGCD(b,a%b);
}
}
int
doLCM(
int
array[],
int
size){
int
x,y,num=array[0],i,gcd;
for
(i=0;(i+1)<size;i++){
x=num;
y=array[i+1];
gcd = getGCD(x,y);
num = x/gcd * y/gcd * gcd;
}
return
num;
}
int
main(
void
){
int
n;
while
(
scanf
(
"%d"
,&n)!=EOF){
int
i,j;
for
(i=0;i<n;i++){
int
t;
scanf
(
"%d"
,&t);
int
array[t];
for
(j=0;j<t;j++){
scanf
(
"%d"
,&array[j]);
}
int
result = doLCM(array,t);
printf
(
"%d\n"
,result);
}
}
return
0;
}