题目链接:HDU1019
CODE:
#include<iostream>
#include<cmath>
using namespace std;
int gcd(int m,int n)
{
if(m%n==0)return n;
else return gcd(n,m%n);
}
long long LCM(int m,int n)
{
return m/gcd(m,n)*n;
}
int main()
{
int kase;cin>>kase;
while(kase--)
{
int n;cin>>n;
int ret=1;
for(int i=0;i<n;i++)
{
int m;cin>>m;
ret=LCM(m,ret);
}
cout<<ret<<endl;
}
}