#include<bits/stdc++.h>
#define For(i,j,k)for(int i=j;i<=k;++i)
using namespace std;
const int N=2010;
int A[N];

bool cmp(int x,int y){
	return A[x]<A[y];
}
int bel[N],cnt[N],rk[N],n,k,q;

int main(){
	scanf("%d%d%d",&n,&k,&q);
	For(i,1,n)scanf("%d",&A[i]),rk[i]=i;
	sort(rk+1,rk+n+1,cmp);
	int ans=1e9;
	For(i,1,n-q+1){
		For(j,0,n)cnt[j]=0;
		For(j,0,n){
			bel[j]=A[j]<A[rk[i]]?j:bel[j-1];
			if(bel[j]!=j)++cnt[bel[j]];
		}
		int ret=0;
		For(j,i,n){
			if(cnt[bel[rk[j]]]>=k){
				++ret,--cnt[bel[rk[j]]];
				if(ret>=q){
					ans=min(ans,A[rk[j]]-A[rk[i]]);
					break;
				}
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}