Time Limit: 2 second(s) | Memory Limit: 32 MB |
There is a huge 2 x N board, six types of tiles are available, and each of them is infinitely many, you have to find the number of ways you can fill the board using the tiles. Two board configurations are different if at least in one cell, their colors differ. The tiles are given below:
You cannot rotate or flip any tile. And no cell in the board should be empty. The tiles shouldn't overlap.
For example, a 2 x 3 board can be colored by 5 ways, they are:
Input starts with an integer T (≤ 10000), denoting the number of test cases.
Each case starts with a line containing an integer N (1 ≤ N ≤ 10^{9}).
For each case, print the case number and the number of ways the board can be colored. The number may be large, so, output the number modulo 10007.
Sample Input |
Output for Sample Input |
5 3 10 20 100 87 |
Case 1: 5 Case 2: 1255 Case 3: 6239 Case 4: 6542 Case 5: 5502 |
Developed and Maintained by
JANE ALAM JAN |
Copyright © 2012
LightOJ, Jane Alam Jan |