#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
template <class S, class T>
istream& operator>>(istream& is, pair<S, T>& p) {
  return is >> p.first >> p.second;
}
template <class T>
istream& operator>>(istream& is, vector<T>& xs) {
  for (auto& x : xs) is >> x;
  return is;
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << p.first << " " << p.second;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& xs) {
  for (unsigned int i = 0; i < xs.size(); ++i) os << (i ? " " : "") << xs[i];
  return os;
}
template <class T>
void maxi(T& x, T y) {
  if (x < y) x = y;
}
template <class T>
void mini(T& x, T y) {
  if (x > y) x = y;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const LL MOD = 1e9 + 7;
const LL INF = 1e15;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  LL N, K, Q;
  cin >> N >> K >> Q;
  VL xs(N);
  cin >> xs;
  LL ans = INF;
  for (int i = (0); i < (N); ++i) {
    LL mn = xs[i];
    LL lb = mn - 1, ub = 1e9 + 10;
    while (ub - lb > 1) {
      LL m = (lb + ub) / 2;
      LL sum = 0;
      LL l = 0, o = 0;
      for (int j = (0); j < (N); ++j) {
        if (xs[j] < mn) {
          sum += min(l + o + 1 - K, l);
          l = o = 0;
          continue;
        } else if (xs[j] <= m) {
          ++l;
        } else
          ++o;
      }
      sum += min(l + o + 1 - K, l);
      if (sum >= Q)
        ub = m;
      else
        lb = m;
    }
    if (ub >= mn && ub <= 1e9) {
      mini(ans, ub - mn);
    }
  }
  cout << ans << endl;
  return 0;
}
