| SanSi Cup 2026 Qualification round |
|---|
| Finished |
Niquillo el Pillo is, among all competitive programmers of Bolivia in all of history, the best, but the best at chess. Now he coaches the Agusstinos team and decides to give them a chess problem. The problem is the following:
There is an $$$n \times n$$$ chessboard. A knight attacks the squares it can jump to: two squares in one direction (horizontal or vertical) and one in the perpendicular direction, as long as they are inside the board.
What is the maximum number of knights that can be placed on the board, at most one per square, so that no knight attacks another?
The first line contains an integer $$$t$$$, the number of test cases.
Each of the following $$$t$$$ lines contains an integer $$$n$$$, the size of the board.
Constraints
For each case, print on one line the maximum number of knights.
3 1 3 8
1 5 32
On the $$$3 \times 3$$$ board, $$$5$$$ knights can be placed: in the four corners and in the center.
| Name |
|---|


