In the game of Royal Gems, you are given an <!-- MATH
$n \times m$
-->
n×m
A neighbor of a cell is one of the four cells that are directly above, below, left, or right of the cells. Write a program that finds the maximum number of ruby gemstones that could be put on the board satisfying the above rules.
There are multiple test cases in the input. Each test case consists of n
$(1 < n < 8)$
-->
(1 < n < 8)
$(1 < m < 8)$
-->
(1 < m < 8)
For each test case, write a single line containing the maximum number of ruby gemstones on the board.
2 2 2 3 3 3 0 0
0 1 2
Migrated from old NTUJ.
ICPC Tehran, 2008
No. | Testdata Range | Score |
---|