#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
int n, k, q;
long long a[N], maxx, b[N], ans;
set<pair<int, int> > s;
bool check(int mid1, int mid2) {
  pair<int, int> temp;
  s.clear();
  for (int i = 1; i <= k; i++) {
    temp.first = a[i], temp.second = i;
    s.insert(temp);
  }
  int now = k;
  for (int i = 1; i <= q; i++) {
    while (((mid1 < (*s.begin()).first) || (mid2 > (*s.begin()).first)) &&
           now <= n) {
      temp.first = a[now - k + 1], temp.second = now - k + 1;
      s.erase(temp);
      now++;
      temp.first = a[now];
      temp.second = now;
      s.insert(temp);
    }
    if ((mid1 < (*s.begin()).first) || (mid2 > (*s.begin()).first))
      return false;
    s.erase(s.begin());
    now++;
    temp.first = a[now], temp.second = now;
    s.insert(temp);
  }
  return true;
}
bool solve(int mid) {
  int l = 1, r = mid - 1;
  long long maxx = -1;
  while (l <= r) {
    long long mid2 = (l + r) >> 1;
    if (check(mid, mid2))
      l = mid2 + 1, maxx = max(maxx, mid2);
    else
      r = mid2 - 1;
  }
  if (maxx >= 1) ans = min(ans, mid - maxx);
  return maxx >= 1;
}
bool comp(long long x, long long y) { return x < y; }
int main() {
  ans = 1e9 + 5;
  scanf("%d %d %d", &n, &k, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), b[i] = a[i];
  sort(b + 1, b + 1 + n, comp);
  int l = 1, r = n;
  for (int i = 1; i <= n; i++) solve(b[i]);
  printf("%lld\n", ans);
}
