For a provided integer \(k\), find the maximum value of \(m+n\), where \(1 \leqslant m,n \leqslant k\) and \((n^2 - nm - m^2)^{2} = 1\).
Note: The answer can exceed the range of a 32-bit integer.
Input format
The only line of the input contains one integer \(k\).
Output format
Print the maximum value of \(m+n\), where \(1 \leqslant m,n \leqslant k\) and \((n^2 - nm - m^2)^{2} = 1\).
Constraints
\(1 \leqslant k \leqslant 10^{18}\)
In the first test case \(k = 2\) , \(n= 2\) and \(m = 1\) satisfying the given condition and maximum value \( = 2+ 1 = 3\).
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor