#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = (((1 << 30) - 1) << 1) + 1;
const int nINF = 1 << 31;
const long long N = 2000;
long long n, k, q, a[N], dp[N][N];
long long rec(long long l, long long r) {
  if (r < l) return INF;
  if (r - l + 1 < q + k - 1) return INF;
  long long& memo = dp[l][r];
  if (memo != -1) return memo;
  vector<long long> v, midxs;
  long long minidx = l;
  midxs.push_back(l);
  for (int i = (l); i <= (r); i++) {
    v.push_back(a[i]);
    if (a[i] < a[minidx]) {
      minidx = i;
      midxs.clear();
      midxs.push_back(i);
    } else if (a[i] == a[minidx]) {
      midxs.push_back(i);
    }
  }
  sort(v.begin(), v.end());
  long long res = v[q - 1] - v[0];
  for (int m : midxs) {
    res = min(res, rec(l, m - 1));
    res = min(res, rec(m + 1, r));
  }
  return memo = res;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 0; i < (n); i++) cin >> a[i];
  for (int i = 0; i < (n); i++) fill(dp[i], dp[i] + n, -1);
  long long ans = rec(0, n - 1);
  cout << ans << endl;
  return 0;
}
