#P814. 愤怒的牛

愤怒的牛

Title description

Farmer John has built a new long barn, with n (2n105)n \ (2 \leq n \leq 10^5) stalls. The stalls are located along a straight line at positions x1,,xn (0xi109)x_1,\dots ,x_n \ (0 \leq x_i \leq 10^9). His c (2cn)c \ (2 \leq c \leq n) cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent the cows from hurting each other, FJ want to assign the cows to the stalls, such that the minimum distance between any two of them is as large as possible. What is the largest minimum distance?

Input

  • Line 11: Two space-separated integers: nn and cc.
  • Lines 2n+12\dots n+1: Line i+1i+1 contains an integer stall location,xix_i.

Output

  • Line 11: One integer:the largest minimum distance.
5 3
1
2
8
4
9
3

Sample description

Put the cows at 11, 44 and 88 so that the minimum distance is 33.

Data scale and convention

For data of 100%100\%2n1052 \le n \le 10^50xi1090 \le x_i \le 10^92cn2 \le c \le n

Topic source

Gold