Online Programming Server

Login

Login with facebook [?]

Facebook

Problem 1100: Fibonacci Numbers

Problem ID 1100
Title Fibonacci Numbers
pdf  
Description
Fibonacci numbers is an interesting sequence. It is defined as follow:

F0 = 0
F1 = 1
Fi = Fi-1 + Fi-2 if i > 1

PP is very interested in Fibonacci Numbers. He asked you to help him to find the Nth Fibonacci number. Since the number is so large, if the number if greater or equal than 10000, just told him the last 4 digit.
Input
The first line contains an integer T (1 ≤ T ≤ 20), the number of Fibonacci numbers PP interested in.
Each test cases contains an integer N (0 ≤ N ≤ 100000) in a single line.
Output
The Nth Fibonacci Number.
Sample Input
5
1
8
12
7
99
Sample Output
1
21
144
13
9026
Hint
 
Last Modified 2012-05-31 14:31:35
Time Limit 1 seconds
Memory Limit 64 MB
Accepted Solutions 0
Submitted Solutions 0
Difficulty Factor 110