unsiged long long 会爆
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod=1e9+7;
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define pb push_back
ll n,m;
ll vis[1005][1005];
ll ans[25];
ll dir[8][2]={{1,2},{1,-2},{-1,2},{-1,-2},{2,1},{2,-1},{-2,1},{-2,-1}};
struct node{
ll x,y,step;
};
void bfs(){
queue<node> q;
node tmp;
tmp.x=500;tmp.y=500;tmp.step=0;
ans[0]=1;vis[500][500]=1; //走0步占1个位置
q.push(tmp);
while(!q.empty()){
node p=q.front();
q.pop();
if(p.step==20)
break;
for(int i=0;i<8;i++){
ll xx=p.x+dir[i][0];
ll yy=p.y+dir[i][1];
if(vis[xx][yy])
continue;
vis[xx][yy]=1;
node tmp;
tmp.x=xx;tmp.y=yy;tmp.step=p.step+1;
ans[tmp.step]++;
q.push(tmp);
}
}
}
int main(){
bfs();
ll sum=1;
for(int i=1;i<=19;i++){
sum+=ans[i];
cout<<"sum "<<sum<<" "<<"level "<<ans[i]<<" "<<ans[i]-ans[i-1]<<endl;
}
return 0;
}
scanf("%llu",&num);
printf("Case #%d: %llu\n",i,anss);
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const int maxn=1e6+5;
ull ans[8]={1,9,41,109,205,325,473,649};
ull n,res;
int T;
int main(){
cin>>T;
for(int i=1;i<=T;i++){
res=0;
cin>>n;
if(n<=6){
cout<<"Case #"<<i<<": "<<ans[n]<<endl;
continue;
}
res=473;
ull cnt=n-6;
res+=cnt*148;
res+=(cnt+1)*cnt/2*28;
cout<<"Case #"<<i<<": "<<res<<endl;
}
return 0;
}