#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
ll tc;
ll n,c, x;
vector<ll> a;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
cin>>tc;
while(tc--)
{
cin>>n>>c;
for(int i=0;i<n;i++)
{
cin>>x;
a.push_back(x);
}
sort(a.begin(),a.end());
ll i=1,j=1000000001,ans=0,l=0;
while(i<=j)
{
ll mid=((j+i)/2);
ll fi=a[0],temp=1;
for(int k=1;k<n;k++)
{
if(a[k]-fi>=mid)
{ temp++;
fi=a[k];
}
}
if(temp<c)
j=mid-1;
else
{
ans=mid;
i=mid+1;
}
}
cout<<ans<<endl;
a.clear();
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgdW5zaWduZWQgbG9uZyBsb25nIGludAp1c2luZyBuYW1lc3BhY2Ugc3RkOwpsbCB0YzsKIGxsIG4sYywgeDsKICAgICAgICB2ZWN0b3I8bGw+IGE7CmludCBtYWluKCkKewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTtjaW4udGllKE5VTEwpO2NvdXQudGllKE5VTEwpOwogICAgCiAgICBjaW4+PnRjOwogICAgd2hpbGUodGMtLSkKICAgIHsKICAgICAgIAogICAgICAgIGNpbj4+bj4+YzsKICAgICAgICAKICAgICAgICBmb3IoaW50IGk9MDtpPG47aSsrKQogICAgICAgIHsKICAgICAgICAgIGNpbj4+eDsKICAgICAgICAgIGEucHVzaF9iYWNrKHgpOwogICAgICAgIH0gIAogICAgICAgIHNvcnQoYS5iZWdpbigpLGEuZW5kKCkpOwogICAgICAgIGxsIGk9MSxqPTEwMDAwMDAwMDEsYW5zPTAsbD0wOwogICAgICAgIHdoaWxlKGk8PWopCiAgICAgICAgewogICAgICAgICAgICBsbCBtaWQ9KChqK2kpLzIpOwogICAgICAgICAgICBsbCBmaT1hWzBdLHRlbXA9MTsKICAgICAgICAgICAgZm9yKGludCBrPTE7azxuO2srKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoYVtrXS1maT49bWlkKQogICAgICAgICAgICAgICAgICAgeyB0ZW1wKys7CiAgICAgICAgICAgICAgICAgICAgZmk9YVtrXTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYodGVtcDxjKQogICAgICAgICAgICAgICAgaj1taWQtMTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBhbnM9bWlkOwogICAgICAgICAgICAgICAgaT1taWQrMTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBjb3V0PDxhbnM8PGVuZGw7CiAgICAgICAgYS5jbGVhcigpOwogICAgfQogICAgcmV0dXJuIDA7Cn0K