#P2678. [NOIP 2015 提高组] 跳石头
[NOIP 2015 提高组] 跳石头
Description
The annual "Jumping Stones" competition is about to begin.
The competition takes place in a straight river channel where some huge rocks are distributed. The organizing committee has chosen two rocks as the start and the finish. Between the start and the finish, there are rocks (excluding the start and finish rocks). During the competition, participants start from the start rock and jump to an adjacent rock at each step until they reach the finish.
To increase the difficulty, the committee plans to remove some rocks so that the minimum jump distance during the competition is as large as possible. Due to budget limits, the committee can remove at most rocks between the start and the finish (the start and finish rocks cannot be removed).
Input Format
The first line contains three integers , representing the distance from the start to the finish, the number of rocks between the start and the finish, and the maximum number of rocks the committee may remove, respectively. It is guaranteed that and .
The next lines each contain one integer. On the -th line, the integer denotes the distance from the start to the -th rock. These rocks are given in increasing order of distance from the start, and no two rocks are at the same position.
Output Format
Output a single integer, which is the maximum possible minimum jump distance.
25 5 2
2
11
14
17
21
4
Hint
Explanation for Sample Input/Output 1
After removing the two rocks at distances and from the start, the minimum jump distance becomes (either when jumping from the rock at distance to the rock at distance , or from the rock at distance to the finish).
Constraints
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号