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

Puzzling Maze

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)
Total Submission(s): 217    Accepted Submission(s): 63


Problem Description
Little A has a lovely toy dog , and she likes it so much . But bad B envy her happiness . So he robbed her little dog and put it in his partner C's house. C's house is like a big maze,so it's so hard for A to find her toy . So she employed some robots to help her . These robots' travel has some principles .

They're listed as follows:

1.One robot can move horizontal and vertical, and it cannot stay at the start grid and not move.

2.Every robot's path must be a circuit .

3.Every two robots' travel path can not cross at any grid,and any grid in the maze must be stepped once and only once.

4.We don't consider the direction those robots move.

5. You can use any numbers of robots, and there are infinitely many robots.

Only after traveling to every grid can A find her toy dog,she wonders how many ways to do this by using robots ?

 

Input
The maze is like an "L" ,as show below. There are multiple test case. Each case contains 2 integers,n and m. We guarantee that m>=n,m<=10^9,1<=n<=7.

 

Output
One integer,the ways to do this . The answer should module 1000000007. Use the format in the sample.
 

Sample Input
2 2 2 3 2 4
 

Sample Output
Case 1: 1 Case 2: 1 Case 3: 4
 

Hint
Answers to the sample input are shown below .






 

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-26 17:01:41, Gzip enabled