#C12349. Fibonacci Sequence and List Evaluation

    ID: 41766 Type: Default 1000ms 256MiB

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:

F0=0F_0 = 0, F1=1F_1 = 1, and for n2n \geq 2, $$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 nn representing the number of values in the list. The next line contains nn 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>