A水题,渐渐发现没有快感了。。
求最小公倍数。
1 #include<stdio.h> 2 #define LL __int64 3 int main() 4 { 5 int T; 6 LL n,s; 7 scanf("%d",&T); 8 while(T--) 9 { 10 scanf("%I64d",&n); 11 if(n==2){ 12 printf("1 "); 13 continue; 14 } 15 if(n%2){ 16 printf("%I64d ",(n/2)*(n/2+1)); 17 continue ; 18 }else { 19 s=n/2; 20 if(s%2){ 21 printf("%I64d ",(s-2)*(s+2)); 22 continue; 23 }else { 24 printf("%I64d ",(s-1)*(s+1)); 25 continue; 26 } 27 } 28 } 29 return 0; 30 }