#P6407. [SDOI2012] 棋盘覆盖
[SDOI2012] 棋盘覆盖
Description
On an chessboard, there are cells called special cells. We want to use a set of Tetris pieces to cover the chessboard, ensuring that special cells cannot be covered, and each non-special cell can be covered by only one Tetris piece. Find the maximum number of Tetris pieces that can be placed.
It is known that there are the following three sets of Tetris pieces, and a chessboard will use one of these sets.

Input Format
The first line contains three integers and a character type, which indicates the set of Tetris pieces used.
The next lines each contain two integers , meaning that the cell in row and column is a special cell.
Output Format
Output one integer, the required answer.
8 8 0 A
32
7 6 6 C
3 1
3 6
5 3
5 4
5 7
6 7
12
Hint
For test points , , , and type is A.
For test points , , are integer powers of , , and type is B.
For test points , , , and type is C.
Translated by ChatGPT 5
京公网安备 11011102002149号