#P5580. [PA 2015] Fibonacci
[PA 2015] Fibonacci
Description
As everyone knows, the Fibonacci sequence satisfies:
Now you are given a digit string . Please find the smallest such that ends with .
Input Format
One line containing a digit string .
Output Format
Output the smallest integer that satisfies the condition.
If there is no solution, output NIE.
025
1525
Hint
Constraints: for of the testdata, the length of is at most , and .
Translated by ChatGPT 5
京公网安备 11011102002149号