Two Knights | CSES Solution

 Two Knights | CSES Solution


  • Time limit: 1.00 s
  •  
  • Memory limit: 512 MB
Your task is to count for  the number of ways two knights can be placed on a  chessboard so that they do not attack each other.

Input

The only input line contains an integer n.

Output

Print n integers: the results.

Constraints
  • 1n10000
Example

Input:
8

Output:
0
6
28
96
252
550
1056
1848

void solve() {

int n;
cin>>n;
for(int i=1; i<=n; i++){
  int total=(i*i)*((i*i) -1)/2;
  int attack=4*(i-1)*(i-2);
  cout<<total-attack<<endl;
}

}

Post a Comment

0 Comments