Last two digits of Fibonacci
Submissions: 4743   Accuracy:

27.78%

  Difficulty: Medium   Marks: 4

Saksham has recently learnt about Fibonacci series, and told his father about it. His father being a mathematician asked him to tell the Nth number of the Fibonacci series.
But, Saksham told his father that it is difficult to solve the series as he is getting very large numbers. His father being lenient made his work less and asked to tell only last two digits of the Nth number of Fibonacci series. Please help Saksham to find the answer.

Note: 1st element of series is 1. And 2nd element of series is 1.
If last 2 digits are 03(for instance) print 3.

Input:
First line of the input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line containing an integer N.

Output:
Corresponding to each test case, print the required output in a new line.

Constraints:
1<=T<=100
1<=N<=109

Example:
Input:
8
1
2
3
4
5
6
7
8
Output:
1
1
2
3
5
8
13
21

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

Author: Contribute.Practice


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.