#P1924. 贴海报
贴海报
Description
There is a wall of size with several holes on it. You need to paste posters on the wall. Each poster is a rectangle, with each side parallel or perpendicular to the wall’s edges. A poster can be placed horizontally or vertically, but no poster may cover any hole. What is the maximum number of posters that can be placed on this wall?
Input Format
The first line contains integers and , indicating that the wall size is .
The next lines each contain integers or . A indicates that position has a hole, and a indicates no hole.
Output Format
Output the maximum number of posters that can be placed.
6 6
0 0 0 1 0 0
0 1 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 1
0 0 0 0 0 0
0 0 0 1 0 0
3
Hint
The testdata guarantees that , .
Translated by ChatGPT 5
京公网安备 11011102002149号