Cover a board

You have an n × m board. In how many mays can you cover it with 1 × 2
pieces?

Input

Input consists of n and m. Assume 2 ≤ nm ≤ 40, and that nm is even.

Output

Print in lexicographical order all the ways to cover the board. To
distinguish the pieces, the two cells of the same piece must have the
same digit, and two adjacent pieces must have different digits. Apart
from that, digits should be as small as possible. (See the sample output
3.) Print a blank line after every solution.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:17:20.713Z

© Jutge.org, 2006–2026.
https://jutge.org
