Problem 5

0

0 votes
Problem

THE PROBLEM STATEMENT:
MSIT has to send a team for a quiz competition. The team is supposed to have (n) members and the team is supposed to have students of semester 2 and semester 4.
The team picked must satisfy the following conditions:
If all the students(n) are placed in row then no two sem2 students should sit next to each other, as in this case a sem2 student can get the maximum help from the seniors in case a difficult question is asked from him/her.

Your task is simple, to calculate the number arrangements possible for a team size, n, if the number of sem2 and sem4 students can vary from one arrangement to another.

For example :
If a team of 3 students is formed, then the possible arrangements are:

Arrangements   Member 1   Member 2    Member 3   
Arrangement 1sem2sem4sem2
Arrangement 2sem2sem4sem4
Arrangement 3sem4sem2sem4
Arrangement 4sem4sem4sem2
Arrangement 5sem4sem4sem4
As it can be seen that teams can be formed in only 5 ways if it is a three
member team, i.e., for n=3.
Therefore for n=3, the answer is 5.
The answer can large, so print the answer modulo 109 +7.

INPUT:
The first line contains the number of test cases t.
Each test case has single line, which contains an integer n, the number of members in the team.

OUTPUT:
For each test case output a single line containing the number of ways a team can be formed with n members.

CONSTRAINTS:
1<=t<=100000
1<=n<=1000000



Problem Code: TARRANGE
Author and Tester:Prateek Kumar

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Explanation for the sample input is in the problem statement.

Editor Image

?