#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
const long long N = 2e5 + 5;
long long n, k, q;
long long a[N], vis[N];
pair<long long, long long> b[N];
vector<long long> v[2][N];
long long connected;
long long root[N], sz[N];
map<long long, long long> store;
void init() {
  for (long long i = 1; i <= n; i++) {
    root[i] = i;
    sz[i] = 1;
  }
  connected = 0;
}
long long rt(long long k) {
  while (k != root[k]) {
    root[k] = root[root[k]];
    k = root[k];
  }
  return k;
}
void merge(long long u, long long v) {
  long long rt1 = rt(u);
  long long rt2 = rt(v);
  if (rt1 == rt2) return;
  connected--;
  store[sz[rt1]]--;
  store[sz[rt2]]--;
  store[sz[rt1] + sz[rt2]]++;
  if (store[sz[rt1]] == 0) {
    store.erase(sz[rt1]);
  }
  if (store[sz[rt2]] == 0) {
    store.erase(sz[rt2]);
  }
  if (sz[rt2] >= sz[rt1]) {
    sz[rt2] += sz[rt1];
    sz[rt1] = 0;
    root[rt1] = root[rt2];
  } else {
    sz[rt1] += sz[rt2];
    sz[rt2] = 0;
    root[rt2] = root[rt1];
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> q;
  init();
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    b[i].first = a[i];
    b[i].second = i;
  }
  sort(b + 1, b + n + 1);
  long long ans = 1e18;
  for (long long i = n; i >= 1; i--) {
    connected++;
    store[1]++;
    long long idx = b[i].second;
    vis[idx] = 1;
    if (vis[idx - 1]) {
      merge(idx, idx - 1);
    }
    if (vis[idx + 1]) {
      merge(idx, idx + 1);
    }
    long long cnt = 0;
    for (auto it : store) {
      cnt += max(0LL, it.first - k + 1) * it.second;
    }
    if (cnt >= q && i + q - 1 <= n) {
      ans = min(ans, b[i + q - 1].first - b[i].first);
    }
  }
  cout << ans;
  return 0;
}
