#include <bits/stdc++.h>
using namespace std;
int main() {
int N,L,K,a,b;
cin>>N>>L>>K;
vector<int> A(N);
for(int i=0;i<N;i++){
cin>>A[i];
}
long long left = -1, right = L + 1;
while(right - left > 1){
long long mid = (left + right) / 2;
a=0;
b=0;
for(int i=0;i<N;i++){
if(A[i]-a>=mid){
b++;
a=A[i];
}
}
if (L-a>=mid) b++;
if(b>=K+1){
left=mid;
}else{
right=mid;
}
}
cout<<left<<endl;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: