#include <stdio.h>
#include <algorithm>

using namespace std;

#define INF 1000000000

int a[2002], n, k, q;
int b[2002];

int f(int l, int r) {
	for(int i=1;i<=n;i++) {
		if(l<=a[i] && a[i]<=r) b[i]=1;
		else if(a[i]<l) b[i]=0;
		else b[i]=2;
	}
	int len=0, c1=0, res=0;
	for(int i=1;i<=n+1;i++) {
		if(b[i]==0) {
			res+=max(0,min(c1,len-k+1));
			len=c1=0;
		} else if(b[i]==1) {
			len++; c1++;
		} else len++;
	}
	return res;
}

int main() {
	scanf("%d %d %d",&n,&k,&q);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	int res=(1<<30);
	for(int i=1;i<=n;i++) {
		int st=a[i];
		if(f(st,INF)<q) continue;
		if(f(st,st)>=q) {
			puts("0");
			return 0;
		}
		int lo=st, hi=INF;
		while(lo+1<hi) {
			int mid=(lo+hi)/2;
			if(f(st,mid)>=q) hi=mid;
			else lo=mid;
		}
		res=min(res,hi-st);
	}
	printf("%d\n",res);
	return 0;
}