#Lutece0099. Flagstone Walk
Flagstone Walk
Migrated from Lutece 99 Flagstone Walk
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
The main hall of UESTC is far from the dormitory. However, poor Hongshu has to go there every day to talk with his teachers. This is the most unhappy thing on the earth. However, Hongshu is so optimistic that he still digs a lot of fun during that boring period.
There is a long flagstone walk on the way from the dormitory to the main hall. This flagstone walk has lines and four flagstones arranged in each line. Hongshu always start from rightmost flagstone of the first line. In order to make this walk funny, he would always step onto the left or right flagstone in the next line if there is. For example, if Hongshu stands at the second rightmost flagstone of the third line, he would choose to step to the first or third rightmost one of the forth line. Note that Hongshu has only one choice when he is at the corner of one line.
Because Hongshu has to go to the main hall every day, he wants to know how many different ways to step across the flagstone walk. Can you help him?
Input
The first line of the input is an integer (), which stands for the number of test cases you need to solve. Each case consists of an integer () on a single line, which stands for the length of the walk.
Output
For each case, print the number of ways on a single line.
Samples
3
2
3
4
1
2
3
Note
Hongshu has ways to choose when the length of walk is .
Resources
The 8th UESTC Programming Contest Preliminary