Nth Fibonacci Number
Submissions: 39982   Accuracy:

30.44%

  Difficulty: Basic   Marks: 1

Given a positive integer N, find the Nth fibonacci number. Since the answer can be very large, print the answer modulo 1000000007.

Input:
The first line of input contains T denoting the number of testcases.Then each of the T lines contains a single positive integer N.

Output:
Output the Nth fibonacci number.

Constraints:
1 <= T <= 200
1 <= N <= 1000
Example:
Input:

3
1
2
5
Output:
1
1
5

** For More Input/Output Examples Use 'Expected Output' option **

Author: dipjal1996


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.