|All-time Popular Problems|
|Maximum difference between node and its ancestor|
|Right View of Binary Tree|
|Delete without head pointer|
|Find the number of islands|
|Delete nodes having greater value on right|
|Reverse Level Order Traversal|
|Binary Tree to DLL|
|Find all pairs with a given sum|
|n'th node from end of linked list|
|Equal to product|
Given N, the number of plots on either sides of the road. Find the total ways to construct buildings in the plots such that there is a space between any 2 buildings. All plots on one side of the road are continuous.
Lets suppose ‘*’ represents a plot, then for N=3, the plots can be represented as * * * | | * * *
Where | | represents the road.
Note: As the answer can be very large, print it mod 1000000007
First line of input contains T denoting number of test cases. Only line of each test case contains one integers N, as described above.
For each test case output a single line containing one integer, the answer to the above problem.
1<= T <= 100000
1<= N <= 105
3 plots, which means possible ways for one side are BSS, BSB, SSS, SBS, SSB where B represents a building and S represents an empty space
Total possible ways are 25, because a way to place on one side can correspond to any of 5 ways on other side.