Donghyuk has a rectangular chessboard. Its rows and columns are numbered from 0. The cell in row i and column j is black if i+j is even and white if i+j is odd. Some cells hold a piece.
Yunho has a large supply of L shaped tiles. One tile is three squares, each the same size as a board cell, joined as in the picture below.
OO
O
Yunho wants to put tiles on Donghyuk's chessboard so that all of the following hold.
- Every tile can be rotated by 90, 180, or 270 degrees.
- Every tile covers three cells of the board.
- Tiles do not overlap.
- A cell that holds a piece cannot be covered by a tile.
- The corner cell of a tile, the cell that touches both of the other two squares, must cover a black cell of the board.
Write a program that finds the maximum number of tiles Yunho can place.