#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1LL << 61;
const long long N = 2e3 + 10;
vector<long long> a(N), c(N);
long long n, k, q;
long long check(long long l, long long r) {
  long long p = 0, s = 0;
  for (long long i = 0; i <= n; i++) {
    if (a[i] < c[l]) {
      long long t = 0;
      for (long long j = p + 1; j < i; j++) {
        if (a[j] <= c[r]) t++;
      }
      s += max(0LL, min(t, i - p - k));
      p = i;
    }
  }
  return s >= q;
}
int main() {
  cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    c[i] = a[i];
  }
  sort(c.begin(), c.end());
  long long ans = inf;
  for (long long i = 0, j = 0; i < n; i++) {
    while (j < n && !check(i, j)) j++;
    if (j < n) ans = min(ans, c[j] - c[i]);
  }
  cout << ans << endl;
}
