#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >>n;
for(int i=0; i<n; i++) {
cin >>m;
int temp, ans;
cin >>ans;
for(int j=1; j<m; j++) {
cin >>temp;
ans = ans/__gcd(ans, temp)*temp;
}
cout <<ans <<endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwgbTsKCWNpbiA+Pm47Cglmb3IoaW50IGk9MDsgaTxuOyBpKyspIHsKCQljaW4gPj5tOwoJCWludCB0ZW1wLCBhbnM7CgkJY2luID4+YW5zOwoJCWZvcihpbnQgaj0xOyBqPG07IGorKykgewoJCQljaW4gPj50ZW1wOwoJCQlhbnMgPSBhbnMvX19nY2QoYW5zLCB0ZW1wKSp0ZW1wOwoJCX0KCQljb3V0IDw8YW5zIDw8ZW5kbDsKCX0KfQ==