luogu#P3853. [TJOI2007] 路标设置
[TJOI2007] 路标设置
Background
There is a long highway between city B and city T. Some places along this highway have signposts, but everyone feels there are too few; adjacent signposts are often separated by a rather long distance. To study this problem, we define the maximum distance between adjacent signposts on the highway as the highway’s "emptiness index".
Problem Description
Now the government plans to add some signposts on the highway to minimize the highway’s "emptiness index". They ask you to design a program to compute the minimum achievable value. Note that the start and the end of the highway are guaranteed to already have signposts, the highway length is an integer, and both existing and newly added signposts must be at integer distances from the start.
Input Format
The first line contains three integers , representing the highway length, the number of existing signposts, and the maximum number of signposts that can be added, respectively.
The second line contains integers in increasing order, representing the positions of the existing signposts. Each position is the distance from the start and lies within the interval .
Output Format
Output one line containing a single integer, the minimum "emptiness index" achievable after adding signposts.
101 2 1
0 101
51
Hint
Originally, the highway had only two signposts at the start and the end. Now you are allowed to add one signpost. You should place the new signpost at a distance of or from the start, which yields the minimum emptiness index of .
Constraints:
- In of the testdata, , .
- In of the testdata, , .
- In of the testdata, .
Translated by ChatGPT 5