The Great Wall of BytelandProblem code: BWALL |
All submissions for this problem are available.
In order to protect the southern border of Bytelandian Empire against intrusions by various nomadic groups, the Emperor of Byteland has decided to build a wall along the southern border. The best architect Johny is recruited for the task.
In order to minimise the cost of raw material, Johny is restricted to use only following two kinds of building blocks:
X #
XX
The height of the wall is fixed and is 2 units, but the length of the wall varies. As a part of his job Johny needs to find out the number of ways he can construct the wall using above two types of building blocks where the length of the wall is specified. Write a program to help Johny.
Input Format:
The first line contains the number of test cases T followed by T lines. Each of the next lines contains an integer N representing the length of the wall.
Output Format:
Print T lines one for each test case, containing an integer that represents the number of ways of constructing the wall, modulo 1000000007.
Example:
Sample Input: 3 7 2 13
Sample Output: 655 5 272767 Constraints: 1<=T<=1000 1<=N<=10^9 Explanation of 2nd Test Case N=2 The wall can be constructed in following 5 ways: ## ##
X# XX
#X XX
XX X#
XX #X
| Author: | nssprogrammer |
| Date Added: | 16-03-2011 |
| Time Limit: | 2 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CPP 4.0.0-8, CPP 4.3.2, CS2, D, JAVA, PAS fpc, PAS gpc |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions

I am not able to understand
I am not able to understand the question well,, what blocks are exactly allowed to used.
in the example there is : ## but nothing like ## ??
## XX
me also ..i cant understand
me also ..i cant understand
The first building block is