#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
double fRand(double fMin, double fMax) {
  double f = (double)rand() / RAND_MAX;
  return fMin + f * (fMax - fMin);
}
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
int n, k, q, a[2005], b[2005], c[2005];
int Solve(int a[]) {
  vector<int> pos;
  pos.push_back(0);
  for (int i = (1); i <= (n); ++i) {
    if (a[i] == -1) pos.push_back(i);
  }
  pos.push_back(n + 1);
  int res = 0;
  for (int i = (0); i <= ((int)pos.size() - 2); ++i) {
    int cnt0 = 0;
    for (int j = (pos[i] + 1); j <= (pos[i + 1] - 1); ++j) {
      if (a[j] == 0) ++cnt0;
    }
    int x = min(cnt0, pos[i + 1] - pos[i] - k);
    res += x;
  }
  return res;
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  for (int i = (1); i <= (n); ++i) b[i] = a[i];
  sort(b + 1, b + n + 1);
  int ans = 1000000007;
  for (int i = (1); i <= (n); ++i) {
    int lo = i, hi = n;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      for (int j = (1); j <= (n); ++j) {
        if (a[j] < b[i])
          c[j] = -1;
        else if (a[j] > b[mid])
          c[j] = 1;
        else
          c[j] = 0;
      }
      if (Solve(c) >= q) {
        ans = min(ans, b[mid] - b[i]);
        hi = mid - 1;
      } else
        lo = mid + 1;
    }
  }
  printf("%d", ans);
  return 0;
}
