#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const int N=2100;
int A[N],w[N],n,K,Q;
int check(int l,int r){
	int pre=1; int ans=0;
//	cout<<"chek "<<l<<" "<<r<<endl;
	for (int i=1;i<=n+1;i++){
		if (i==n+1||A[i]<l){
			if (i-pre>=K){
				int num=0;
			//	cout<<pre<<" "<<i-1<<endl;
				for (int j=pre;j<i;j++)
					if (A[j]<=r) num++;
				ans+=min(num,i-pre-K+1);
			}
			pre=i+1;
		}
	}
	return ans>=Q;
}
int main(){
	scanf("%d%d%d",&n,&K,&Q);
	for (int i=1;i<=n;i++) scanf("%d",&A[i]),w[i]=A[i];
	sort(w+1,w+n+1);
	int r=1; int ans=2e9;
	for (int i=1;i<=n;i++){
		while (r<=n&&check(w[i],w[r])==0) r++;
		//cout<<w[i]<<" "<<w[r]<<endl;
		if (r>n) continue;
		ans=min(ans,w[r]-w[i]);
	}
	cout<<ans<<endl;
}