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

Honeycomb Walk

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 522    Accepted Submission(s): 242


Problem Description
A bee larva living in a hexagonal cell of a large honeycomb decides to creep for a walk. In each ¡°step¡± the larva may move into any of the six adjacent cells and after n steps, it is to end up in its original cell.
Your program has to compute, for a given n, the number of different such larva walks.
 

Input
The first line contains an integer giving the number of test cases to follow. Each case consists of one line containing an integer n, where 1 ¡Ü n ¡Ü 14.
 

Output
For each test case, output one line containing the number of walks. Under the assumption 1 ¡Ü n ¡Ü 14, the answer will be less than 231 - 1.
 

Sample Input
2 2 4
 

Sample Output
6 90
 

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-04-27 02:28:58, Gzip enabled