#include<stdio.h>
int main()
{
int a;
long long b;
while(scanf("%d",&a)!=EOF){
if(a%2==1){
b=(a+1)*(2*a*a+3*a-1)/8;
}
else{
b=a*(a+2)*(2*a+1)/8;
}
printf("%lld\n",b);
}
return 0;
}
ZCMU 1265: 数三角形
最新推荐文章于 2024-09-08 09:53:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)