#include<bits/stdc++.h>
#define o 3005
using namespace std;
int a[o],b[o];
int n,K,Q,ans;
bool check(int l,int r)
{
	int x=1,y,num=0,zm=0;
	while(x<=n)
	{
		if(a[x]<l)
		{
			x++;
			continue;
		}
		y=x;
		while(y<n&&a[y+1]>=l) y++;
		zm=0;
		for(int k=x; k<=y; k++) if(a[k]<=r) zm++;
		num+=min(zm,max((y-x+1)-(K-1),0));
		x=y+1;
	}
	return num>=Q;
}
int main()
{
	scanf("%d%d%d",&n,&K,&Q);
	for(int i=1; i<=n; i++) scanf("%d",&a[i]),b[i]=a[i];

	sort(b+1,b+n+1);
	ans=b[Q]-b[1];
	int sz=1;
	for(int i=2; i<=n; i++) if(b[i]!=b[i-1]) b[++sz]=b[i];
	for(int i=1; i<=sz; i++)
	{
		int l=i,r=sz,mid,as=0;
		while(l<=r)
		{
			mid=(l+r)>>1;
			if(check(b[i],b[mid])) as=mid,r=mid-1;
			else l=mid+1;
		}
		if(as) ans=min(ans,b[as]-b[i]);
	}
	cout<<ans<<endl;
}