luogu#P10939. 骑士放置
骑士放置
Problem Description
Given an chessboard, some cells are forbidden for placing pieces.
Find the maximum number of knights (the “knight” in international chess, similar to the “horse” in Chinese chess, which attacks in an L-shape, but without the “blocked leg” rule in Chinese chess) that can be placed on the board so that no two knights attack each other.
Input Format
The first line contains three integers , where is the number of forbidden cells.
The next lines each contain two integers and , indicating that the cell at row , column is forbidden for placement. Rows and columns are numbered starting from .
Output Format
Output one integer representing the result.
2 3 0
4
Hint
Translated by ChatGPT 5