//return b?gad(b,a%b):a;
#include<iostream>
using namespace std;
long long gad(long long x,long long y){return y?gad(y,x%y):x;
}
int main(){long long a[1010];int t;cin>>t;while(t--){int n;cin>>n;for(int i=0;i<n;i++)cin>>a[i];for(int i=1;i<n;i++){a[i]=(a[i]*a[i-1])/gad(a[i],a[i-1]);}cout<<a[n-1]<<endl;}
}
/*Sample Input
2
3 5 7 15
6 4 10296 936 1287 792 1
Sample Output
105
10296*/