#include<bits/stdc++.h>
using namespace std;
#define MN 2000
int n,k,q,a[MN+5],c[MN+5];
bool check(int l,int r)
{
	int p=0,i,j,t,s=0;
	for(i=1;i<=n+1;++i)if(a[i]<c[l])
	{
		for(t=0,j=p;++j<i;)if(a[j]<=c[r])++t;
		s+=max(0,min(t,i-p-k));p=i;
	}
	return s>=q;
}
int main()
{
	int i,j,ans=1e9;
	scanf("%d%d%d",&n,&k,&q);
	for(i=1;i<=n;++i)scanf("%d",&a[i]),c[i]=a[i];
	sort(c+1,c+n+1);
	for(i=j=1;i<=n;++i)
	{
		while(j<=n&&!check(i,j))++j;
		if(j<=n)ans=min(ans,c[j]-c[i]);
	}
	printf("%d",ans);
}