-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwoKnights.cpp
More file actions
51 lines (51 loc) · 1.08 KB
/
Copy pathTwoKnights.cpp
File metadata and controls
51 lines (51 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "bits/stdc++.h"
// #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
long long n;
cin>>n;
for(int i=1;i<=n;i++){
if(i==1){
cout<<0<<endl;
continue;
}
if(i==2){
cout<<6<<endl;
continue;
}
if(i==3){
cout<<28<<endl;
continue;
}
if(i==4){
cout<<96<<endl;
continue;
}
if(i==5){
cout<<252<<endl;
continue;
}
if(i==6){
cout<<550<<endl;
continue;
}
if(i==7){
cout<<1056<<endl;
continue;
}
if(i==8){
cout<<1848<<endl;
continue;
}
long long total=0;
total+=((i-4)*1LL*(i-4))*((i*1LL*i)-9);
total+=4*((i*1LL*i)-5);
total+=8*((i*1LL*i)-4);
total+=4*((i*1LL*i)-3);
total+=(i-4)*4*((i*1LL*i)-5);
total+=(i-4)*4*((i*1LL*i)-7);
cout<<total/2<<endl;
}
}