#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 1;
int n, k, q, a[N], MAX = 1e9;
set<pair<int, int> > f;
bool del[N];
bool check(int L, int R) {
  f.clear();
  for (int i = 1; i <= k - 1; i++) f.insert(pair<int, int>(a[i], i));
  int dem = 0;
  memset(del, false, sizeof(del));
  int j = 1;
  for (int i = k; i <= n; i++) {
    while (int(f.size()) > k - 1) {
      while (del[j]) j++;
      f.erase(pair<int, int>(a[j], j));
      del[j] = true;
    }
    f.insert(pair<int, int>(a[i], i));
    int val = f.begin()->first, id = f.begin()->second;
    if (int(f.size()) == k && val >= L && val <= R) {
      f.erase(f.begin());
      dem++;
      if (dem == q) return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> q;
  int lo = 1e9, hi = 0, res;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    hi = max(hi, a[i]);
    lo = min(lo, a[i]);
    MAX = max(MAX, a[i]);
  }
  hi = hi - lo;
  lo = 0;
  while (lo <= hi) {
    int mid = (lo + hi) >> 1;
    bool flag = false;
    for (int i = 1; i <= n; i++) {
      if (check(a[i], min(MAX, a[i] + mid))) {
        flag = true;
        break;
      }
    }
    if (flag) {
      res = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  cout << res;
}
