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

Peace small elephant

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 291    Accepted Submission(s): 181


Problem Description
Xiao Ming likes playing the international chess ,especially like the elephant(it can move by slant while no barrier),

but he think the big elephant of the chess is cruel,and a kind of small elephant is not as cruel as the big elephant.

Its attack range is checks on the ramp of the small elephant's check's right angle.Now Ming is going to put many small elephants on his chessboard.

It's interesting that when two small elephants have a common side they'll become one solidarity elephant,

and more than 2 small elephants also can do this if satisfy the condition,and the attack range of solidarity elephants is same as the small elephant.

Now there is a requirement that it's empty on anyone of elephants' attack range(no piece).Xiao Ming has a special chessboard with $m*n$ checks.

Please figure out the number of all the plans that satisfy the condition.As the number is too big,we need to have a modulo $1000000007$.

The following is pictures show the attack range of elephants with different shape,"X"means attack range.


 

Input
There are at most $5$ testcases .

For each testcase contains two integers $n,m$ ,meaning as in the title.
$1 \leq n \leq 1000000000,1 \leq m\leq 7$
 

Output
For each testcase print a single integer - the number of all the plans that satisfy the condition.
 

Sample Input
1 1 2 3
 

Sample Output
2 50
 

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-05-05 10:47:58, Gzip enabled