FIBOFAST - Not Fibonacci please

no tags 

Okay, so its again the old Fibonacci question. Print the nth Fibonacci number.

Input

First line contains 't', the number of test cases. Each test case contains a number 'n' < 10^8. 

Output

Print the nth Fibonacci number (mod 1000000007)  in one line. 

Example

Input:
3
1
2
Output: 1
1

hide comments
Ankur Singh: 2016-04-14 07:11:37

i am getting WA. Can anyone give answer for these TC
4
1000000
10000000
100000000
234567

Finally got AC. Here are answers to above TC
918091266
490189494
908460138
669404320

Last edit: 2016-04-14 17:33:00
Ayush Verma: 2011-10-29 06:21:15

For n close to 10^8 it will go out of range for even long double.
please help..
i was using the Binet's formula.

hendrik: 2011-10-20 13:37:18

This has been asked already. Problem BIGFIBB.

numerix: 2011-10-20 13:37:18

Should be moved to tutorial!


Added by:Nikunj Jain
Date:2011-10-16
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64