e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Fibonacci Numbers

Fibonacci Numbers

The Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements F0 and F1 which are respectively zero and one.

prb681

What is the numerical value of the nth Fibonacci number?

For each test case, a line will contain an integer i between 0 and 108 inclusively, for which you must compute the ith Fibonacci number Fi. Fibonacci numbers get large pretty quickly, so whenever the answer has more than 8 digits, output only the first and last 4 digits of the answer, separating the two parts with an ellipsis ("...").

There is no special way to denote the end of the of the input, simply stop when the standard input terminates (after the EOF).

Time limit 1 second
Memory limit 64 MiB
Input example #1
0
1
2
3
4
5
35
36
64
65
Output example #1
0
1
1
2
3
5
9227465
14930352
1061...7723
1716...7565