Mr TJ’s father owns a farm and wishes to sell his Apples. Mr TJ was asked by his father to visit the farm daily and tell him the number of apples that are good and ready to be sold. Mr. TJ’s father has already visited the farm twice and noted down the number of good apples to be 1 on each day. When Mr TJ goes to the farm, the third day he notices 7 good apples. On fourth day, he notices 19 good apples. Mr TJ, being a very lazy, tries to find a pattern in the number of apples.
1, 1, 7, 19, 73…
He soon realizes the pattern to be little bit similar to Fibonacci series. Mr. TJ does not want to go the farm daily and asked you to help. Mr TJ wants to calculate number of good apples on the nth day.
First line of input will contain an integer T, denoting the number of test cases. Each test case contains an integer n, denoting the nth day.
For each test case in a new line print the number of good apples on the nth day.
Note: As the number of good apples may be very large, output the answer modulo 109+7.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.