#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n, k, q;
int a[N], v[N];
inline int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
inline int check(int l, int r) {
  int ret = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] < l || a[i] > r) continue;
    int j = i, la = 0, cnt = 1;
    while (i > 1 && a[i - 1] > l && la != k - 1) ++la, --i;
    la = 0;
    while (j < n) {
      if (a[j + 1] < l) break;
      if (a[j + 1] > r) {
        if (la == k - 1) break;
        ++la;
      } else
        ++cnt, la = 0;
      ++j;
    }
    ret += min(cnt, j - i - k + 2), i = j;
  }
  return ret;
}
int main() {
  int ans = 1 << 30;
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) a[i] = v[i] = gi();
  sort(v + 1, v + 1 + n);
  for (int i = 1, j = 1; i <= n; i++) {
    while (j <= n && check(v[i], v[j]) < q) ++j;
    if (j > n) break;
    ans = min(ans, v[j] - v[i]);
  }
  cout << ans;
  return 0;
}
