#P7536. [COCI 2016/2017 #4] Rekonstruiraj
[COCI 2016/2017 #4] Rekonstruiraj
Description
Given a closed interval and an initially empty set. In each operation, choose a real number , and add to the set all real numbers among that lie within the closed interval (duplicate numbers in the set are kept only once).
Now you are given all real numbers in the final set. Find a plan such that, with the minimum number of operations, the set after performing the operations is exactly the same as the given set.
Input Format
The first line contains an integer , the number of real numbers in the final set.
The second line contains two integers , indicating that only real numbers within the closed interval will be added.
Each of the next lines contains a real number with at most digits after the decimal point. It is guaranteed that these real numbers are strictly increasing.
Output Format
Output lines, where is the number of operations in your plan.
In the next lines, output one real number per line. These real numbers represent the chosen real numbers for the operations, in order. The output order does not matter.
If there are multiple valid plans, output one with the minimum number of operations. If there are multiple plans with the minimum number of operations, output any one of them.
4
1 2
1
1.4
1.5
2
0.5
0.7
5
10 25
12
13.5
18
20.25
24
6.0
6.75
Hint
[Explanation for Sample 1]
Another valid plan is to choose the real numbers and .
[Constraints]
For of the testdata, all input integers are natural numbers.
For of the testdata, and .
[Hints and Notes]
This problem uses a self-written Special Judge. You are welcome to hack it (submit a general problem-report ticket).
Translated from COCI 2016-2017 CONTEST #4 T4 Rekonstruiraj.
The score of this problem follows the original COCI settings, with a full score of .
Translated by ChatGPT 5
京公网安备 11011102002149号