ACcode:
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+100;
int n,m,c,a[N];
bool check(int x) { //max
int cnt=0,ans=0;
int be=a[1];
for(int i=1; i<=n; ) {
if(a[i]-be<=x&&cnt<c) {
cnt++;
i++;
} else {
be=a[i];
cnt=0;
ans++;
}
}
if(cnt!=0)ans++;
return ans<=m;
}
void solve() {
cin>>n>>m>>c;
for(int i=1; i<=n; i++)cin>>a[i];
sort(a+1,a+1+n);
int l=0,r=1e9+1;
while(l+1<r) {
int mid=l+r>>1;
if(check(mid))r=mid;
else l=mid;
}
cout<<r<<"\n";
}
signed main() {
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int t=1;
//cin>>t;
while(t--) {
solve();
}
return 0;
}
okk