Consider the problem of building a wall out of and bricks (horizontal×vertical dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form a "running crack".
For example, the following wall is not acceptable due to the running crack shown in red:
There are eight ways of forming a crack-free wall, written .
The only line of each test file contains three integers separated by single spaces: , and .