#include<bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define st first
#define nd second

typedef long long ll;
typedef pair < int , int > pp;
const int mod = 1e9 + 7;
const int N   = 2e3 + 3;

int A[N],B[N],n,k,q,i,j,ans;

int f(int b, int e){
    int i,las,t,x;
    las = t = x = 0;
    for(i=1;i<=n+1;i++){
        if(A[i] < b) { x += max(0, min(t , i-las-k)); las = i; t = 0; }
        else if(A[i] <= e) t++;
    }
    return x;
}

int main(){
    cin >> n >> k >> q;
    for(i=1;i<=n;i++) { cin >> A[i]; B[i] = A[i]; }
    sort(B+1 , B+n+1);
    ans = mod;
    for(i=j=1; i<=n; i++){
        for(; j <= i && f(B[j],B[i]) >= q ; j++)
            ans = min(ans , B[i]-B[j]);
    }

    if(ans == mod) assert(0);
    cout << ans << endl;
    return 0;
}   