#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define gc getchar()
inline int read(){
	int x=0,f=1;char c=gc;
	for(;c<48||c>57;c=gc)
		if(c=='-')f=-1;
	for(;c>47&&c<58;c=gc)
		x=x*10+c-48;
	return x*f;
}
#define io read()

#define maxn 2005
int n,m,q,a[maxn];

inline void init(){
	n=io;m=io;q=io;
	for(int i=1;i<=n;++i)a[i]=io;
}

inline int check(int d){
	for(int i=1;i<=n;++i){
		int s0=0,s1=0,cnt=0;
		for(int j=1;j<=n;++j){
			if(a[j]>a[i]+d)++s0;
			else if(a[j]>=a[i])++s1;
			else{
				cnt+=max(0,min(s1+s0-m+1,s1));
				s1=s0=0;				
			}
		}
		cnt+=max(0,min(s1+s0-m+1,s1));
		if(cnt>=q)return 1;
	}
	return 0;
}

inline void solve(){
	int l=0,r=1e9,mid,ans;
	while(l<=r){
		mid=l+r>>1;
		if(check(mid)){
			ans=mid;
			r=mid-1;
		}else{
			l=mid+1;
		}
	}
	printf("%d\n",ans);
}

int main(){
	init();
	solve();
	return 0;
}