讲道理多个数的最小公倍数就是俩数的最小公倍数和第三个的最小公倍数…
以此类推
水死了
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int gcd(int a, int b)
{
if (b == 0) return a;
return gcd(b, a%b);
}
int main()
{// 4 294 967 296
int t;
cin >> t;
while (t--)
{
int y;
cin >> y;
long long tem = 1;
for (int a = 1;a <= y;a++)
{
int p;
cin >> p;
tem =tem*p/ gcd(tem, p);
}
cout << tem << endl;
}
return 0;
}