AGGRCOW - Aggressive cows

题意翻译

好斗的奶牛 题目描述: 农夫约翰搭建了一间有N间牛舍的小屋。牛舍排在一条线上,第i号牛舍在Xi的位置。但是他的M头牛对小屋很不满意,因此经常相互攻击。约翰为了防止牛之间相互伤害,因此决定把每头牛都放在离其他牛尽可能远的牛舍。求最近的两头牛之间距离的最大值。 输入格式: t – 表示有t组数据,每组数据都由下面格式的数据构成。 - 第1行: 两个用空格隔开的整数: N和C - 第2到n+1行: 每行一个整数xi 输出格式: 每组输出一个整数: 最近两头牛之间距离的最大值.

题目描述

Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000). His C (2 <= C <= 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 wants 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?

输入输出格式

输入格式


_t_ – the number of test cases, then _t_ test cases follows. \* Line 1: Two space-separated integers: N and C \* Lines 2..N+1: Line i+1 contains an integer stall location, xi

输出格式


For each test case output one integer: the largest minimum distance.

输入输出样例

输入样例 #1

1
5 3
1
2
8
4
9

输出样例 #1

3