http://acm.hdu.edu.cn/showproblem.php?pid=2028
#include<stdio.h>#include<string.h>
#include<math.h>
#include<ctype.h>
int main()
{
int n;
int i;
int a[100];
int tem;
while(~scanf("%d",&n))
{
tem=0;
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
tem=tem>a[i]?tem:a[i];
}
for(i=1;i<=n;i++)
{
if(tem%a[i]!=0)
{
tem++;
//i=1;
i=0;
}
}
printf("%d\n",tem);
}
return 0;
}