#include <bits/stdc++.h>
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define ff first
#define ss second
#define IN insert
#define endl "\n"
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define rev(i,a,b) for(ll i=a; i>=b; i--)
#define decimal(n) fixed << setprecision(n)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) v.size()
#define total_sum(v) accumulate(all(v),0)
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define n_p(v) next_permutation(all(v))
#define p_p(v) prev_permutation(all(v))
#define for_each(it, X) for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++)
#define printv(a) rep( i, 0, sz(a) ) cout<<a[i]<<" "; cout<<endl;
#define prints(a) for_each(it, a) cout<<*it<<" "; cout<<endl;
#define printvll(a) rep(i,0,sz(a)) cout<<a[i].ff<<" "<<a[i].ss<<endl;
#define re return
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
typedef vector < pii > vii;
typedef vector < pll > vll;
typedef vector < int > vi;
typedef vector < ll > vl;
typedef vector < vl > vvl;
typedef vector < string > vs;
typedef vector < vs > vvs;
typedef set< ll > sl;
typedef set< string > ss;
typedef set< pll > sll;
typedef multiset< ll > msl;
typedef map< ll, ll > ml;
ll gcd ( ll , ll );
ll lcm ( ll , ll );
bool isPrime( ll );
ll power( ll , ll );
ll fact( ll );
void sieve_of_eratosthenes ( ll , vl & );
ll roof(ll , ll);
bool isPalindrome( string );
//---------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ll MOO = 998244353;
const double pi = 3.14159265358979323846;
const ll MAX = 100010;
ll n,i,v[100005],c;
bool check(int d)
{
ll h=1, p=v[0];
rep(i,1,n) {
if(v[i]-p>=d) {
h++;
p=v[i];
}
}
if(h>=c) {
re 1;
}
re 0;
}
void solve()
{
cin>>n>>c;
rep(i,0,n) {
cin>>v[i];
}
sort(v,v+n);
ll l=0, r=v[n-1]-v[0];
while(l+1<r) {
ll mid=l+(r-l)/2;
if(check(mid)) {
l=mid;
}
else {
r=mid;
}
}
cout<<l<<endl;
}
int main()
{
boost;
ll t=1;
cin>>t;
rep(i,0,t)
{
// cout<<"Case #"<<i+1<<": ";
solve();
// cout<<endl;
}
}
//---------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------
// HCF
ll gcd ( ll a , ll b ) {
return __gcd ( a , b ) ;
/*
if ( a==0 )
return b ;
return gcd ( b%a , a ) ;
*/
}
// LCM
ll lcm ( ll a , ll b ) {
return ( a * b ) / ( __gcd ( a , b ) ) ;
}
// PRIME
bool isPrime( ll n )
{
for( ll i=2 ; i*i<=n ; i++)
{
if( n % i == 0)
return false;
}
return true;
}
// POWER
ll power( ll a , ll b) {
ll c=INF;
ll ans=1;
while(b) {
if(b%2) {
ans=ans*a;
}
a=a*a;
b>>=1;
}
return ans;
}
// FACTORIAL
ll fact(ll n) {
ll m=INF;
ll h = 1;
rep(i,1,n+1) {
h=(h*i);
}
return h;
}
// SIEVE of ERATOSTHENES
void sieve_of_eratosthenes (ll n, vl &a) {
a[0]=a[1]=0;
for(ll i=2; i*i<=10000007 ; i++) {
if(a[i]) {
for(ll j=i+i; j<=10000007 ; j+=i) {
a[j]=0;
}
}
}
}
// CEILING FUNCTION
ll roof(ll a, ll b) {
return (a + b - 1) / (b) ;
}
// PALINDROME
bool isPalindrome(string s) {
rep(i,0,sz(s)/2) {
if(s[i]!=s[sz(s)-i-1]) re 0;
}
re 1;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lICAgICBib29zdCAgICAgICAgICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBjaW4udGllKDApOyBjb3V0LnRpZSgwKTsJCiNkZWZpbmUgICAgIHBiICAgICAgICAgICAgICAgcHVzaF9iYWNrCQojZGVmaW5lICAgICBwZiAgICAgICAgICAgICAgIHB1c2hfZnJvbnQKI2RlZmluZSAgICAgcG9iICAgICAgICAgICAgICBwb3BfYmFjawojZGVmaW5lICAgICBwb2YgICAgICAgICAgICAgIHBvcF9mcm9udAkKI2RlZmluZSAgICAgbXAgICAgICAgICAgICAgIG1ha2VfcGFpcgojZGVmaW5lICAgICBmZiAgICAgICAgICAgICAgIGZpcnN0CiNkZWZpbmUgICAgIHNzICAgICAgICAgICAgICAgc2Vjb25kCiNkZWZpbmUgICAgIElOICAgICAgICAgICAgICAgaW5zZXJ0CiNkZWZpbmUgICAgIGVuZGwgICAgICAgICAgICAgIlxuIgoKI2RlZmluZSAgICAgcmVwKGksYSxiKSAgICAgICBmb3IobGwgaT1hOyBpPGI7IGkrKykKI2RlZmluZSAgICAgcmV2KGksYSxiKSAgICAgICBmb3IobGwgaT1hOyBpPj1iOyBpLS0pCgojZGVmaW5lICAgICBkZWNpbWFsKG4pICAgICAgIGZpeGVkIDw8IHNldHByZWNpc2lvbihuKSAKI2RlZmluZSAgICAgYWxsKHYpICAgICAgICAgICB2LmJlZ2luKCksIHYuZW5kKCkgCiNkZWZpbmUgICAgIHJhbGwodikgICAgICAgICAgdi5yYmVnaW4oKSwgdi5yZW5kKCkKI2RlZmluZSAgICAgc3oodikgICAgICAgICAgICB2LnNpemUoKQojZGVmaW5lICAgICB0b3RhbF9zdW0odikgICAgIGFjY3VtdWxhdGUoYWxsKHYpLDApICAKCiNkZWZpbmUgICAgIG1ha2VfdW5pcXVlKHYpICAgdi5lcmFzZSh1bmlxdWUoYWxsKHYpKSx2LmVuZCgpKQojZGVmaW5lICAgICBuX3AodikgICAgICAgICAgIG5leHRfcGVybXV0YXRpb24oYWxsKHYpKQojZGVmaW5lICAgICBwX3AodikgICAgICAgICAgIHByZXZfcGVybXV0YXRpb24oYWxsKHYpKQoJCgojZGVmaW5lICAgIC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