#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
int n, m, apply_count, w;
int main(int argc, char *argv[]) {
  cin >> n >> w >> apply_count;
  vector<int> d(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> d[i];
  }
  int l = 0, r = MOD;
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if ([&]() {
          for (int low : d) {
            int up = low + mid;
            int small = 0, large = 0;
            int can = 0;
            for (int i = 0; i < (int)(n); i++) {
              if (d[i] < low) {
                small = large = 0;
              } else if (up < d[i]) {
                large++;
              } else {
                small++;
              }
              if (w <= large + small && small) {
                can++;
                small--;
              }
            }
            if (apply_count <= can) return true;
          }
          return false;
        }())
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return 0;
}
