#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9 + 5;
int N, K, Q, a[2005];
unordered_set<int> distinct;
vector<int> b;
bool print(int x, int y) { return x == 1 && y == 8; }
bool possible(int large, int small) {
  int streak = 0;
  int inRange = 0;
  int taken = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] < small) {
      streak = 0;
      continue;
    }
    streak++;
    if (a[i] >= small && a[i] <= large) inRange++;
    if (streak >= K && inRange > 0) {
      inRange--;
      taken++;
    }
  }
  return taken >= Q;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (!distinct.count(a[i])) {
      distinct.insert(a[i]);
      b.push_back(a[i]);
    }
  }
  sort(b.begin(), b.end());
  int M = b.size();
  int ans = INF;
  for (int i = 0; i < M; i++) {
    int Y = b[i];
    int lo = i;
    int hi = M - 1;
    int best = INF;
    while (lo <= hi) {
      int m = (lo + hi) / 2;
      int X = b[m];
      if (possible(X, Y)) {
        best = min(best, m);
        hi = m - 1;
      } else {
        lo = m + 1;
      }
    }
    if (best == INF) continue;
    ans = min(ans, b[best] - Y);
  }
  cout << ans;
}
