FIBOFAST - Not Fibonacci please

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

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

hide comments
2016-04-14 07:11:37 Ankur Singh
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
2011-10-29 06:21:15 Ayush Verma
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.
2011-10-20 13:37:18 hendrik
This has been asked already. Problem BIGFIBB.
2011-10-20 13:37:18 numerix
Should be moved to tutorial!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.