131. Hardwood floor
time limit per test: 0.25
The banquet hall of Computer Scientists' Palace has a rectangular form of the size M x N (1<=M<=9, 1<=N<=9). It is necessary to lay hardwood floors in the hall. There are wood pieces of two forms:
The first line contains natural number M. The second line contains a natural number N.
First line should contain the number X, or 0 if there are no solutions.