Aniruddha and HackerEarth
Practice
2 (7 votes)
Dynamic programming
Recursion
Algorithms
Easy
Mathematics
Open
Approved
Problem
14% Success 4909 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Aniruddha loves to code on HackerEarth. There are some type of problems which he likes the most. Problems are tagged with non empty strings containing only 'H' or 'E' or both. But he likes the problems tagged with strings containing no consecutive E's. Given an integer N, find maximum number of problems Aniruddha may like which are tagged with strings of length less than or equal to N.

Input
First line contains single integer, T, the number of test cases. Each of next T lines contains single integer N.

Output
For each test case output single integer, the answer to the problem i.e maximum number of problems Aniruddha may like which are tagged with strings of length less than or equal to N. Output answer modulo 109 + 7 (i.e. 1000000007).

Constraints
1T10^6
1N10^6

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
94 votes
Tags:
MathematicsOpenApprovedEasy
Points:20
155 votes
Tags:
MathematicsLucky-DigitEasySimple-math
Points:20
21 votes
Tags:
Bit manipulationBasic ProgrammingApprovedEasyBit manipulation