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
3 Output: 1
1
2
hide comments
Ankur Singh:
2016-04-14 07:11:37
i am getting WA. Can anyone give answer for these TC
|
|
Ayush Verma:
2011-10-29 06:21:15
For n close to 10^8 it will go out of range for even long double.
|
|
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 |