PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000391. Khoảng cách trạm xăng nhỏ nhất (Minimize Max Distance to Gas Station)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Khoảng cách trạm xăng nhỏ nhất (Minimize Max Distance to Gas Station)

Minimize Max Distance to Gas Station

Source: LeetCode

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn gas stations at distinct integer coordinates a1<a2<⋯<ana_1<a_2<\cdots<a_n on a line. Add exactly kk stations at arbitrary real coordinates. Minimize the largest distance between consecutive stations after the additions.

Input

The first line contains integers n,kn,k, the current and additional station counts. The second line contains the nn strictly increasing integers a1,…,ana_1,\ldots,a_n.

Output

Print the minimum possible value. Absolute error must not exceed 10−610^{-6}.

Subtasks

  • Subtask 1 (20 points): 10≤n≤200010\le n\le2000; 1≤k≤101\le k\le10; 0≤ai≤1080\le a_i\le10^8 for all 1≤i≤n1\le i\le n; ai<ai+1a_i<a_{i+1} for all 1≤i<n1\le i<n.
  • Subtask 2 (30 points): 10≤n≤200010\le n\le2000; 1≤k≤20001\le k\le2000; 0≤ai≤1080\le a_i\le10^8 for all 1≤i≤n1\le i\le n; ai<ai+1a_i<a_{i+1} for all 1≤i<n1\le i<n.
  • Subtask 3 (50 points): 10≤n≤200010\le n\le2000; 1≤k≤10000001\le k\le1000000; 0≤ai≤1080\le a_i\le10^8 for all 1≤i≤n1\le i\le n; ai<ai+1a_i<a_{i+1} for all 1≤i<n1\le i<n.

Examples

Input

10 9
1 2 3 4 5 6 7 8 9 10

Output

0.500000000000

Explanation

Place one station at the midpoint of each of the nine unit gaps. Every new gap is 0.5. A smaller maximum requires at least two new stations per original gap, or 18 in total.

Input

10 1
23 24 36 39 46 56 57 65 84 98

Output

14.000000000000

Explanation

The initial gaps of lengths 19 and 14 lie between 65 and 84, and between 84 and 98, respectively. Place the new station at 74.5, dividing the 19-unit gap into two gaps of length 9.5. All remaining gaps are at most 14. A maximum below 14 would require splitting both of the original gaps, which cannot be done with one station.