#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2055;
struct BIT {
  int d[MAXN];
  void upd(int x, int r) {
    for (; x < MAXN; x += ((x) & (-(x)))) d[x] += r;
  }
  int get(int x) {
    int r = 0;
    for (; x; x -= ((x) & (-(x)))) r += d[x];
    return r;
  }
  int get(int s, int e) { return s <= e ? get(e) - get(s - 1) : 0; }
} bit;
set<pair<int, int> > PQ;
int A[MAXN], O[MAXN];
int N, K, Q, Ans = (0x3f3f3f3f), Sum;
int main() {
  ios::sync_with_stdio(false);
  cin >> N >> K >> Q;
  for (int i = 1; i <= N; i++) cin >> A[i];
  iota(O, O + N + 1, 0);
  sort(O + 1, O + N + 1, [&](int a, int b) { return A[a] < A[b]; });
  PQ.insert(pair<int, int>(1, N));
  for (int s = 1, e = 1; s <= N; s++) {
    for (; Sum < Q && e <= N; e++) {
      int i = O[e];
      auto it = prev(PQ.lower_bound(pair<int, int>(i, (0x3f3f3f3f))));
      int p, q;
      tie(p, q) = *it;
      Sum -= min(bit.get(p, q), q - p + 2 - K);
      bit.upd(i, 1);
      Sum += min(bit.get(p, q), q - p + 2 - K);
    }
    if (Sum < Q) break;
    int t = A[O[e - 1]] - A[O[s]];
    if (t < Ans) Ans = t;
    int i = O[s];
    auto it = prev(PQ.lower_bound(pair<int, int>(i, (0x3f3f3f3f))));
    int p, q;
    tie(p, q) = *it;
    PQ.erase(it);
    Sum -= min(bit.get(p, q), q - p + 2 - K);
    bit.upd(i, -1);
    if (p < i) {
      PQ.insert(pair<int, int>(p, i - 1));
      Sum += min(bit.get(p, i - 1), i - p + 1 - K);
    }
    if (i < q) {
      PQ.insert(pair<int, int>(i + 1, q));
      Sum += min(bit.get(i + 1, q), q - i + 1 - K);
    }
  }
  cout << Ans << endl;
  return 0;
}
