#P2105. K皇后
K皇后
Description
Xiao Z recently found a chessboard with rows and columns. The row and column coordinates of the cells are numbered starting from . He wants to place queens on the board. He wants to know how many cells will not be attacked after he places these queens.
Note: A queen attacks the entire row, the entire column, and both diagonals that pass through its position.
Input Format
The first line contains three positive integers , representing the number of rows and columns of the board, and the number of queens Xiao Z places.
The next lines each contain two positive integers , indicating that a queen is placed at row , column . It is guaranteed that no two queens are placed on the same cell.
Output Format
Output a single integer: the number of cells on the board that are not attacked.
12 13 6
10 4
12 10
1 1
2 3
3 2
2 6
25
Hint
- For of the testdata, , .
- For an additional of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号