#C11827. Fibonacci Sequence Generation

    ID: 41186 Type: Default 1000ms 256MiB

Fibonacci Sequence Generation

Fibonacci Sequence Generation

Given a non-negative integer n, generate the first n elements of the Fibonacci sequence.

The Fibonacci sequence is defined as follows:

\(F(0)=0, F(1)=1\) and for \(n \geq 2, F(n)=F(n-1)+F(n-2)\).

If n is less than or equal to 0, the output should be empty.

inputFormat

The input consists of a single integer n provided via standard input.

Example:

5

outputFormat

Output the first n Fibonacci numbers separated by a single space to standard output.

For n = 0, output nothing.

Example:

0 1 1 2 3
## sample
0