1469 拼图


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

一个hw的矩阵,只用12的矩阵拼,有多少种不同的方法数。

12的矩阵可以横着放,也可以竖着放,但小矩阵之间不能重叠,而且要把hw恰好拼满。

Input

输入包含多组数据。每组数据由两个整数组成,大矩阵的高h和宽w(1<=h,w<=11)。 输入以h=w=0终止。

Output

对每组数据,输出拼成给定的矩阵的不同方法数。 每组数据结果占一行。

Sample

Input

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

Output

1
0
1
2
3
5
144
51205

Source: Boski.Jr


Comments

There are no comments at the moment.