#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n, m, q, a[N], ans;
vector<int> vs(N, 0), vis(N);
int id = 0, id2;
bool check(int L, int R) {
  id++;
  id2++;
  int tax = 0;
  priority_queue<pair<int, int> > Q;
  queue<int> idxs;
  int ret = 0;
  for (int i = 0; i < n; i++) {
    Q.push({-a[i], i});
    idxs.push(i);
    while (vis[Q.top().second] == id2) {
      Q.pop();
      tax--;
    }
    if (Q.size() - tax == m) {
      pair<int, int> ltl = Q.top();
      if (-ltl.first >= L && -ltl.first <= R) {
        ret++;
        Q.pop();
        vs[ltl.second] = id;
      } else {
        while (idxs.size() && vs[idxs.front()] == id) idxs.pop();
        int ix = idxs.front();
        vis[ix] = id2;
        tax++;
        idxs.pop();
      }
    }
  }
  return ret >= q;
}
int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = 1000000000;
  for (int i = 0; i < n; i++) {
    int l = a[i], r = 1000000000;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (check(a[i], mid)) {
        ans = min(mid - a[i], ans);
        r = mid - 1;
      } else
        l = mid + 1;
    }
  }
  cout << ans;
  return 0;
}
