题号:NC15421
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
There are n stations on the road, which are located at x
1 ... x
n (x
1 < x
2 < ... < x
n).
Your task is to choose k locations to put signs (signs could be put at anywhere, not necessary to be at a station). Let c(i,j) be the distance from the i-th station to the closest sign between station i and station j. c(i,j) = |x
i - x
j| if there's no sign between them. Find the optimal solution of the sign locations to minimize
)
.
输入描述:
The input will consist of multiple test cases. Each case begins with two integers n and k. (0 ≤ k ≤ 200, 2 ≤ n ≤ 10000)
The following line contains n integers, x1 ... xn (0 ≤ x1 < x2 < ... < xn ≤ 107).
输出描述:
For each test case print one integer, the minimal value of
.