#include <stdio.h>
int gcd(int a,int b){
if(b==0)
return a;
return gcd(b,a%b);
}
int main(){
int a[1005];
int i,n,sum;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
sum=1;
for(i=1;i<=n;i++){
sum=a[i]/gcd(sum,a[i])*sum;
}
printf("%d\n",sum);
return 0;
}
B - !সহজ ~কঠিন -- (n个数最小公倍数,gcd)
最新推荐文章于 2022-02-21 16:18:14 发布