#C13866. Fibonacci Sequence Generator

    ID: 43451 Type: Default 1000ms 256MiB

Fibonacci Sequence Generator

Fibonacci Sequence Generator

Given a single integer \( n \), generate the first \( n \) numbers in the Fibonacci sequence. The Fibonacci sequence is defined as:

\( 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.

For example:

  • Input: 5, Output: 0 1 1 2 3
  • Input: 10, Output: 0 1 1 2 3 5 8 13 21 34

inputFormat

The input is a single integer \( n \) provided via standard input (stdin). This integer specifies the number of Fibonacci sequence elements to generate.

outputFormat

Output the first \( n \) Fibonacci numbers separated by a single space to standard output (stdout). If \( n \) is non-positive, output an empty line.

## sample
0