#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;int n,k,q,a[2005],b[2005];
inline bool chk(int l,int r) {int ans=0,cnt1=0,cnt2=0;
	for (register int i=1;i<=n;++i) {
		if (l<=a[i]&&a[i]<=r) ++cnt1,++cnt2;
		else if (l<=a[i]) ++cnt2;
		else ans+=max(0,min(cnt2-k+1,cnt1)),cnt1=cnt2=0;
	}return ans+max(0,min(cnt2-k+1,cnt1))>=q;
}int main() {int ans=0x3f3f3f3f;scanf("%d%d%d",&n,&k,&q);
	for (register int i=1;i<=n;++i) scanf("%d",a+i),b[i]=a[i];
	sort(b+1,b+n+1);for (register int i=1;i<=n;++i) {int l=i,r=n,mid;
		while (l<=r) mid=l+r>>1,(chk(b[i],b[mid])?ans=min(ans,b[mid]-b[i]),r=mid-1:l=mid+1);
	}printf("%d",ans);return 0;
}