Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-fibonachchi-ketma-ketligi

Array of Fibonacci numbers

Easy 1000 ms 128 MB 26%
Share

A positive integer $n$ is given. Build and print the array of the first $n$ Fibonacci numbers:

$$F_{1} = 1, \quad F_{2} = 1, \quad F_{k} = F_{k-1} + F_{k-2}$$

An array of Fibonacci numbers

Input

One positive integer $n$.

Output

One line with $n$ Fibonacci numbers separated by spaces.

Note

$1 \le n \le 40$

Examples

Input #1
6
Output #1
1 1 2 3 5 8
Input #2
2
Output #2
1 1

Sign in to submit a solution

Signing up is free and takes a minute.