#SDNU1062. Fibonacci
Fibonacci
Description
In the Fibonacci integer sequence, = 0, = 1, and = − 1 + − 2 for .
Format
Input
a single line containing (where )
Output
print in a single line.
Samples
99999999999
669753982
Hints
An alternative formula for the Fibonacci sequence is
As a reminder, matrix multiplication is associative, and the product of two 2 × 2 matrices is given by
Also, note that raising any 2 × 2 matrix to the 0th power gives the identity matrix: