#include <bits/stdc++.h>
using namespace std;
int n, k, q, a[2000 + 5], c[2000 + 5];
bool check(int l, int r) {
  int p = 0, i, j, t, s = 0;
  for (i = 1; i <= n + 1; ++i)
    if (a[i] < c[l]) {
      for (t = 0, j = p; ++j < i;)
        if (a[j] <= c[r]) ++t;
      s += min(t, i - p - k);
      p = i;
    }
  return s >= q;
}
int main() {
  int i, j, ans = 1e9;
  scanf("%d%d%d", &n, &k, &q);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]), c[i] = a[i];
  sort(c + 1, c + n + 1);
  for (i = j = 1; i <= n; ++i) {
    while (j <= n && !check(i, j)) ++j;
    if (j <= n) ans = min(ans, c[j] - c[i]);
  }
  printf("%d", ans);
}
