最小公倍数等于两数之积除以最大公约数。
//2014-3-11 09:03:09
#include <stdio.h>
int gcd(int a, int b){
int t;
while(b){
t = a % b;
a = b;
b = t;
}
return a;
}
int main(){
int t, n, a, s;
scanf("%d", &t);
while(t--){
scanf("%d", &n);
s = 1;
while(n--){
scanf("%d", &a);
s = s / gcd(s, a) * a;
}
printf("%d\n", s);
}
return 0;
}