#P10871. [COTS 2022] 皇后 Kraljice
[COTS 2022] 皇后 Kraljice
Background
Translated from Izborne Pripreme 2022 (Croatian IOI/CEOI Team Selection) D1T1。。
Problem Description
There is an chessboard. Place queens on empty squares one by one, maximizing the number of queens placed. You need to construct a valid plan.
A queen can be placed on a square if and only if that square is attacked by an even number of queens.
A queen attacks a square if and only if the queen's square and the attacked square are in the same row, column, or diagonal.
Input Format
One line with an integer 。
Output Format
The first line contains an integer , the maximum number of queens that can be placed.
The next lines each contain two integers , describing the position where a queen is placed.
1
1
1 1
2
1
1 1
3
9
2 3
3 1
2 2
1 1
3 3
3 2
1 2
1 3
2 1
Hint
Sample Explanation
Explanation for sample :

Constraints
For of the data, it is guaranteed that 。
| Subtask ID | Points | Constraints |
|---|---|---|
| No additional constraints |
Translated by ChatGPT 5