#include <bits/stdc++.h>
using namespace std;
long long N, K, Q;
long long A[2010];
long long B[2010];
bool flg[2010];
signed main() {
  cin >> N >> K >> Q;
  for (long long(i) = 0; (i) < (N); (i)++) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort((B), (B) + (N));
  long long min = LLONG_MAX;
  for (long long i = 0; i < N - Q; i++) {
    if (i > 0) {
      for (long long j = 0; j < N; j++) {
        if (B[i] > A[j]) {
          flg[j] = true;
        }
      }
    }
    long long n = B[i + Q - 1] - B[i];
    long long cost = 0;
    long long a = 0;
    for (long long j = 0; j < N; j++) {
      if (!flg[j]) {
        a++;
      } else {
        cost += (((0) > (a - K + 1)) ? (0) : (a - K + 1));
        a = 0;
      }
    }
    cost += (((0) > (a - K + 1)) ? (0) : (a - K + 1));
    if (cost >= Q) {
      if (min > n) {
        min = n;
      }
    }
  }
  cout << min << endl;
}
