Mondrian's Dream


Submit solution

Points: 1
Time limit: 2.0s
Memory limit: 256M

Problem type
Allowed languages
C++, Python

Domino Tiling

Find the number of ways to tile an N × M chessboard with 1 × 2 dominoes.

For example, when N=2, M=4, there are 5 ways. When N=2, M=3, there are 3 ways.

Input Format

The input contains multiple test cases.

Each test case occupies one line and contains two integers N and M.

When the input is N=0, M=0, it indicates the end of input, and this case should not be processed.

Output Format

For each test case, output one result per line.

Constraints

1 ≤ N, M ≤ 11

Sample Input

1 2
1 3
1 4
2 2
2 3
2 4
2 11
4 11
0 0

Sample Output

1
0
1
2
3
5
144
51205

Comments

There are no comments at the moment.