需要用到头文件:#
函数:__gcd(a,b);
代码:
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n,k;
ll a[1005];
int main(){
cin>>n;
cin>>k;
for(int i=2;i<=n;i++){
cin>>a[i];
k=k/__gcd(k,a[i])*a[i];
}
cout<<k<<endl;
return 0;
}片