
#include <bits/stdc++.h>
// #include <iostream>
#define int long long
#define max(a,b) (a>b?a:b)
// #define min(a,b) (a<b?a:b)
using namespace std;
const int N = 100005;
int n,c,x,y;
int p,t,mi;
int a[N],s;
int b[N];
signed main(){
ios::sync_with_stdio(0);
cin.tie(NULL);
cin >> n >> c >> x;
for(int i = 1; i <= n; i++)
cin >> a[i];
sort(a+1,a+1+n);
int ma = 0;
for(int i = 1; i <= n; i++){
p = a[i];
s++,t++;
if(t == 1) mi = i;
if(t == x || i == n){
b[i] = mi;
ma = max(p-a[mi],ma);
// cout << t << " " << p << " " << mi << endl;
t = 0,y++;
}
}
if(n % x){
if(1){}
}
while(1){break;} //
cout << ma << endl;
return 0;
}
想到大概这样解,但是总感觉有更优解()