#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y){
return y ? gcd(y, x % y) : x;
}
int lcm(int x, int y){
return x/gcd(x,y)*y;
}
int main(){
int T, m, x, ans;
scanf("%d", &T);
while(T--){
ans = 1;
scanf("%d", &m);
while(m--){
scanf("%d", &x);
ans = lcm(ans, x);
}
printf("%d\n", ans);
}
return 0;
}
09-06
09-06
09-06