42 - Andrew Stankevich's Contest, Warmup - 1005
Find the number of ways to tile an m*n rectangle with long dominoes -- 3*1 rectangles.
Each domino must be completely within the rectangle, dominoes must not overlap (of course, they may touch each other), each point of the rectangle must be covered.
The input contains several cases. Each case stands two integers m and n (1 <= m <= 9, 1 <= n <= 30) in a single line. The input ends up with a case of m = n = 0.
Output the number of ways to tile an m*n rectangle with long dominoes.
3 3 3 10 0 0