#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
long long A[2000];
int main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  long long ma = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    ma = max(ma, A[i]);
  }
  long long ans = 1 << 30;
  for (int i = 0; i < N; i++) {
    long long l = A[i] - 1, r = ma;
    bool ok = 0;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      long long cnt = 0;
      long long len = 0;
      long long sum = 0;
      for (int j = 0; j < N; j++) {
        if (A[j] < A[i]) {
          sum += min(cnt, max(len - K + 1, 0LL));
          len = 0;
          cnt = 0;
        } else {
          len++;
          if (A[j] <= m) cnt++;
        }
      }
      sum += min(cnt, max(len - K + 1, 0LL));
      if (sum >= Q)
        r = m, ok = 1;
      else
        l = m;
    }
    if (ok) ans = min(ans, r - A[i]);
  }
  cout << ans << endl;
}
