Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

2489.   Honeycomb Walk
Time Limit: 0.5 Seconds   Memory Limit: 65536K
Total Runs: 346   Accepted Runs: 235



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 specifications

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 specifications

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.

Sample input

2
2
4

Output for sample input

6
90


Source: Nordic Collegiate Contest 2006
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.2.4