F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Solid Dominoes Tilings

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 394    Accepted Submission(s): 250


Problem Description
Dominoes are rectangular tiles with nice 2 ¡Á 1 and 1 ¡Á 2 sizes.

The tiling is called solid if it is not possible to split the tiled rectangle by a straight line, not crossing the interior of any tile. For example, on the picture below the tilings (a) and (b) are solid, while the tilings (c) and (d) are not.



Now the managers of the company wonder, how many different solid tilings exist for an m ¡Á n rectangle. Help them to find that out.
 

Input
The input file contains $m$ and $n (1 \leq m, n \leq 16)$.
 

Output
Output one integer number mod 1e9+7 - the number of solid tilings of m¡Án rectangle with 2 ¡Á 1 and 1 ¡Á 2 pavement tiles.
 

Sample Input
2 2 5 6 8 7
 

Sample Output
0 6 13514
 

Hint

All solid tilings for the 5¡Á6 rectangle are provided on the picture below:

 

Author
HIT
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 09:19:18, Gzip enabled