#include <bits/stdc++.h>
using namespace std;
int n, range, req, lis[2222], ans, cnt;
set<pair<int, int> > s;
pair<int, int> sor[2222];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> range >> req;
  for (long long i = (0); i <= ((long long)(n)-1); i++)
    cin >> lis[i], sor[i] = {lis[i], i};
  sort(sor, sor + n);
  ans = sor[req - 1].first - sor[0].first;
  s.insert({0, 0});
  s.insert({n - 1, 2});
  cnt = n - range + 1;
  for (int l = 1; l + req - 1 < n; l++) {
    int ind = sor[l - 1].second;
    auto it = s.upper_bound({ind, 1});
    int high = it->first;
    it--;
    int low = it->first;
    cnt -= max(0, high - low - range + 1) - max(0, ind - 1 - low - range + 1) -
           max(0, high - ind - 1 - range + 1);
    if (cnt >= req) ans = min(ans, sor[l + req - 1].first - sor[l].first);
  }
  cout << ans;
}
