#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1E9 + 7);
}
long long inf = (long long)1E16;
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
void Max(long long &pos, long long val) { pos = max(pos, val); }
void Min(long long &pos, long long val) { pos = min(pos, val); }
void Add(long long &pos, long long val) { pos = mod(pos + val); }
long double EPS = 1E-9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  long long a[n];
  for (long long i = 0; i <= n - 1; i++) cin >> a[i];
  long long ans = inf;
  for (long long i = 0; i <= n - 1; i++) {
    long long B[n];
    for (long long j = 0; j <= n - 1; j++) {
      if (a[j] < a[i])
        B[j] = 0;
      else
        B[j] = 1;
    }
    long long ok = inf, ng = a[i];
    while (abs(ok - ng) > 1) {
      long long b[n];
      for (long long i = 0; i <= n - 1; i++) b[i] = B[i];
      long long mid = (ok + ng) / 2;
      for (long long j = 0; j <= n - 1; j++) {
        if (a[j] > mid) b[j] = 2;
      }
      long long cnt = 0;
      for (long long j = 0; j <= n - 1; j++) {
        long long s = 0, s2 = 0;
        while (j <= n - 1 && b[j] != 0) {
          s++;
          if (b[j] == 2) s2++;
          j++;
        }
        if (s < k) continue;
        cnt += s + 1 - k - max(0, s2 + 1 - k);
      }
      if (cnt >= q)
        ok = mid;
      else
        ng = mid;
    }
    Min(ans, ok - a[i]);
  }
  cout << ans << "\n";
  return 0;
}
