#P10126. 「Daily OI Round 3」Pigeon
「Daily OI Round 3」Pigeon
Background
Recently, are you busy? You did not even call me. Oh, really? Hehe, turns out I never gave you my number. But still, that is not an excuse for you not to look for me. Next time, I will punish you to keep me company until the sun comes up. —— recollect_i's blog.
Problem Description
recollect_i gives you a sequence of length . You need to find a real number such that for all , , or report that there is no solution.
Input Format
The first line contains an integer , representing the length of the sequence.
The second line contains integers , representing the sequence.
Output Format
If there is a solution, output the string lovely on the first line, and output a real number on the second line.
To avoid precision issues, if your output satisfies that for all , , then your answer is considered correct.
You also need to ensure that , and that has no more than digits after the decimal point. Otherwise, the correctness of judging cannot be guaranteed.
If there is no solution, output the string pigeon in one line.
5
1 2 3 4 5
lovely
-114514
5
3 2 1 6 7
lovely
3.1416
5
3 2 1 4 5
pigeon
Hint
[Hint]
In the output format, is only to avoid precision issues. You may treat it as requiring .
It can be proven that if there is a solution, then there must exist a satisfying and for all , , and the number of digits after the decimal point does not exceed .
[Constraints]
For all testdata: , .
Translated by ChatGPT 5