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

~/algor $ cat problems/while-n-dan-katta-fibonachchi

Fibonacci number above n

Medium 1000 ms 64 MB 48%
Share

The Fibonacci numbers are defined as follows:

$$F_{1} = 1, \qquad F_{2} = 1, \qquad F_{k} = F_{k-1} + F_{k-2} \ (k \ge 3)$$

A positive integer $n$ is given. Find the smallest $k$ such that $F_{k} \gt n$, and the value of $F_{k}$.

The first number in the Fibonacci chain that passes the given bound

Input

One positive integer $n$.

Output

One line with two integers separated by a space: $k$ and $F_{k}$.

Note

$1 \le n \le 10^{18}$

Examples

Input #1
10
Output #1
7 13
Input #2
13
Output #2
8 21

Sign in to submit a solution

Signing up is free and takes a minute.