#C12349. Fibonacci Sequence and List Evaluation
Fibonacci Sequence and List Evaluation
Fibonacci Sequence and List Evaluation
In this problem, you are required to compute Fibonacci numbers for a list of non-negative integers. The Fibonacci sequence is defined by the recurrence relation:
, , and for , $$F_n = F_{n-1} + F_{n-2}.$$
Given a list of integers, for each integer, compute the corresponding Fibonacci number. If any integer is negative, output the error message Fibonacci number is not defined for negative integers.
and terminate the program immediately.
inputFormat
The input begins with an integer representing the number of values in the list. The next line contains space-separated integers.
outputFormat
For each integer in the list, output a line with the integer and its corresponding Fibonacci number separated by a space. If any integer is negative, output the error message: Fibonacci number is not defined for negative integers.
## sample
5
0 1 2 3 4
0 0
1 1
2 1
3 2
4 3
</p>