Problems > Two Peaceful Knights

Two Peaceful Knights

Difficulty: 1600 2000 ms 128 MB

math combinatorics

For every board size k = 1..N, count the ways to place two knights on a k×k chessboard so they do NOT attack each other. Print N lines.

Input: one integer N.

Output: N lines: the count for each k.

Constraints:

  • 1 ≤ N ≤ 104

Sample Tests

Input 1
3
Output 1
0
6
28
Input 2
1
Output 2
0

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.