#P5580. [PA 2015] Fibonacci
[PA 2015] Fibonacci
Background
Update: output any that satisfies the condition. Thanks to
https://www.luogu.com.cn/user/60990
Problem 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