LearnPy Hub
← NumPy problems
Hard

Fibonacci by Matrix Power

The matrix [[1, 1], [1, 0]] raised to the power n holds F(n+1), F(n) and F(n−1). Read n values (each 1–90) and print F(n) for each using np.linalg.matrix_power with dtype=np.int64, one per line.

Input

Integers separated by spaces.

Output

Lines.

Sample 1

Input
1 2 10
Output
1
1
55

Sample 2

Input
90
Output
2880067194370816120
solution.py
Output appears here
Fibonacci by Matrix Power · Python practice problem · LearnPy Hub