#P10909. [蓝桥杯 2024 国 B] 立定跳远

[蓝桥杯 2024 国 B] 立定跳远

Problem Description

At a sports meet, Xiaoming starts a standing long jump from the origin on the number line and jumps in the positive direction. The event has nn checkpoints a1,a2,,ana_1, a_2, \cdots, a_n, and aiai1>0a_i \ge a_{i-1} > 0. Xiaoming must jump to each checkpoint in order, and he can only land on checkpoints. Also, Xiaoming may add mm more checkpoints by himself to make the jumps easier.

Before the sports meet, Xiaoming makes a training plan so that the maximum distance of a single jump reaches LL, and he also learns a burst skill that can be used once during the event. When he uses it, the maximum distance for that jump becomes 2L2L. Xiaoming wants to know: what is the minimum value of LL that allows him to complete the event?

Input Format

The input has 22 lines.

The first line contains two positive integers n,mn, m.

The second line contains nn positive integers a1,a2,,ana_1, a_2, \cdots, a_n separated by spaces.

Output Format

Output 11 line containing one integer, which is the answer.

5 3
1 3 5 16 21
3

Hint

[Sample Explanation]

Add checkpoints 10,13,1910, 13, 19. Then the jump distances are 1,2,2,5,3,3,3,21, 2, 2, 5, 3, 3, 3, 2. Use the skill on the third jump.

[Constraints]

For 20%20\% of the testdata, n102n \le 10^2, m103m \le 10^3, ai103a_i \le 10^3.
For 100%100\% of the testdata, 2n1052 \le n \le 10^5, m108m \le 10^8, 0<ai1080 < a_i \le 10^8.

Translated by ChatGPT 5