#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  vector<long long> B(A);
  sort((B).begin(), (B).end());
  A.push_back(-1);
  B.push_back(INF);
  long long ans = INF;
  for (int left = 0; left < (N); ++left) {
    int ub = N;
    int lb = left;
    int right;
    while (ub - lb > 1) {
      right = (ub + lb) / 2;
      int cnt = 0;
      int cnt1 = 0;
      int cnt2 = 0;
      for (int i = 0; i < (N); ++i) {
        if (B[left] <= A[i]) cnt1++;
        if (B[left] <= A[i] && A[i] <= B[right]) cnt2++;
        if (A[i + 1] < B[left]) {
          cnt += min(max(0, cnt1 - K + 1), cnt2);
          cnt1 = 0;
          cnt2 = 0;
        }
      }
      if (cnt >= Q)
        ub = right;
      else
        lb = right;
    }
    ans = min(ans, B[ub] - B[left]);
  }
  cout << ans << endl;
}
