您的位置:首页 > 其它

hdu 4627 The Unsolvable Problem

2013-07-30 18:12 375 查看
A水题,渐渐发现没有快感了。。

求最小公倍数。

#include<stdio.h>
#define LL __int64
int main()
{
int T;
LL n,s;
scanf("%d",&T);
while(T--)
{
scanf("%I64d",&n);
if(n==2){
printf("1\n");
continue;
}
if(n%2){
printf("%I64d\n",(n/2)*(n/2+1));
continue ;
}else {
s=n/2;
if(s%2){
printf("%I64d\n",(s-2)*(s+2));
continue;
}else {
printf("%I64d\n",(s-1)*(s+1));
continue;
}
}
}
return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: