17
21
778
高级会员
#include <bits/stdc++.h> using namespace std; int t,n; int main(){ cin>>t; while(t--){ cin>>n; if(n%2==0) cout<<n*(n+2)*(2*n+1)/8<<endl; else cout<<(n+1)*(2*n*n+3*n-1)/8<<endl; } }
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|DiscuzX
GMT+8, 2025-2-13 02:00 , Processed in 0.054288 second(s), 34 queries .
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.. 技术支持 by 巅峰设计