#include <bits/stdc++.h>
#define fl(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define nl endl
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define PII pair<int,int>
#define EPs 1e-9
#define INF 1e16
#define setBit(i,n) (i|1<<n)
#define clearBit(i,n) (i&(~(1<<n)))
#define toggleBit(i,n) (i^1<<n)
#define isOn(i,n) ((i&1<<n) != 0)
using namespace std;
ll n, c;
ll a[1000000];
bool check(ll x){
ll cows = 0, last = a[0];
cows++;
for(int i = 1; i < n; i++){
if(a[i]-last >= x){
cows++;
if(cows == c) return true;
last = a[i];
}
}
return false;
}
ll binsearch(){
ll low = 0, high = INF, mid;
while(low+1 < high){
mid = (low+high)>>1;
if(check(mid)){
low = mid;
}
else
high = mid;
}
return low;
}
int main()
{
int t;
cin >> t;
while(t--){
cin >> n >> c;
for(int i = 0; i < n; i++) cin >> a[i];
sort(a,a+n);
cout << binsearch() << nl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgoKI2RlZmluZSBmbChpLG4pICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspCgojZGVmaW5lIGxsICAgbG9uZyBsb25nCiNkZWZpbmUgbmwgICBlbmRsCiNkZWZpbmUgcGIgICBwdXNoX2JhY2sKI2RlZmluZSBtcCAgIG1ha2VfcGFpcgojZGVmaW5lIGZpICAgZmlyc3QKI2RlZmluZSBzZSAgIHNlY29uZAojZGVmaW5lIFBJSSAgcGFpcjxpbnQsaW50PgoKI2RlZmluZSBFUHMgIDFlLTkKI2RlZmluZSBJTkYgIDFlMTYKCiNkZWZpbmUgc2V0Qml0KGksbikgICAgIChpfDE8PG4pCiNkZWZpbmUgY2xlYXJCaXQoaSxuKSAgIChpJih+KDE8PG4pKSkKI2RlZmluZSB0b2dnbGVCaXQoaSxuKSAgKGleMTw8bikKI2RlZmluZSBpc09uKGksbikgICAgICAgKChpJjE8PG4pICE9IDApCgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCgoKbGwgbiwgYzsKbGwgYVsxMDAwMDAwXTsKCgpib29sIGNoZWNrKGxsIHgpewogICAgbGwgY293cyA9IDAsIGxhc3QgPSBhWzBdOwogICAgY293cysrOwogICAgZm9yKGludCBpID0gMTsgaSA8IG47IGkrKyl7CiAgICAgICAgaWYoYVtpXS1sYXN0ID49IHgpewogICAgICAgICAgICBjb3dzKys7CiAgICAgICAgICAgIGlmKGNvd3MgPT0gYykgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGxhc3QgPSBhW2ldOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBmYWxzZTsKfQoKCmxsIGJpbnNlYXJjaCgpewogICAgbGwgbG93ID0gMCwgaGlnaCA9IElORiwgbWlkOwogICAgd2hpbGUobG93KzEgPCBoaWdoKXsKICAgICAgICBtaWQgPSAobG93K2hpZ2gpPj4xOwogICAgICAgIGlmKGNoZWNrKG1pZCkpewogICAgICAgICAgICBsb3cgPSBtaWQ7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICAgICAgaGlnaCA9IG1pZDsKICAgIH0KICAgIHJldHVybiBsb3c7Cn0KCgoKaW50IG1haW4oKQp7CiAgICBpbnQgdDsKICAgIGNpbiA+PiB0OwogICAgd2hpbGUodC0tKXsKICAgICAgICBjaW4gPj4gbiA+PiBjOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspIGNpbiA+PiBhW2ldOwogICAgICAgIHNvcnQoYSxhK24pOwogICAgICAgIGNvdXQgPDwgYmluc2VhcmNoKCkgPDwgbmw7CiAgICB9CgoKICAgIHJldHVybiAwOwp9Cg==