#include <bits/stdc++.h>
using namespace std;
long long DPmin[2010][2010];
long long DPqqq[2010][2010];
long long A[2010];
const long long N = 2010;
struct KthSmallest {
  struct Seg {
    long long l, r, mid;
    void set(long long _l, long long _r) {
      l = _l;
      r = _r;
      mid = l + r >> 1;
    }
  } seg[N << 2];
  long long b[25][N], left[25][N], sorted[N];
  void init(long long *a, long long n) {
    for (long long i = 0; i < n; ++i) b[0][i] = sorted[i] = a[i];
    sort(sorted, sorted + n);
    build(0, n, 0, 1);
  }
  void build(long long l, long long r, long long d, long long idx) {
    seg[idx].set(l, r);
    if (l + 1 == r) return;
    long long mid = seg[idx].mid;
    long long lsame = mid - l;
    for (long long i = l; i < r; ++i)
      if (b[d][i] < sorted[mid]) lsame--;
    long long lpos = l, rpos = mid, same = 0;
    for (long long i = l; i < r; ++i) {
      left[d][i] = (i != l ? left[d][i - 1] : 0);
      if (b[d][i] < sorted[mid]) {
        left[d][i]++;
        b[d + 1][lpos++] = b[d][i];
      } else if (b[d][i] > sorted[mid]) {
        b[d + 1][rpos++] = b[d][i];
      } else {
        if (same < lsame) {
          same++;
          left[d][i]++;
          b[d + 1][lpos++] = b[d][i];
        } else {
          b[d + 1][rpos++] = b[d][i];
        }
      }
    }
    build(l, mid, d + 1, idx << 1);
    build(mid, r, d + 1, idx << 1 | 1);
  }
  long long kth(long long l, long long r, long long k, long long d = 0,
                long long idx = 1) {
    if (l + 1 == r) return b[d][l];
    long long ltl = (l != seg[idx].l ? left[d][l - 1] : 0);
    long long tl = left[d][r - 1] - ltl;
    if (tl >= k) {
      long long newl = seg[idx].l + ltl;
      long long newr = seg[idx].l + ltl + tl;
      return kth(newl, newr, k, d + 1, idx << 1);
    } else {
      long long mid = seg[idx].mid;
      long long tr = r - l - tl;
      long long ltr = l - seg[idx].l - ltl;
      long long newl = mid + ltr;
      long long newr = mid + ltr + tr;
      return kth(newl, newr, k - tl, d + 1, idx << 1 | 1);
    }
  }
  long long rank(long long l, long long r, long long x, long long d = 0,
                 long long idx = 1) {
    if (seg[idx].l + 1 == seg[idx].r) {
      return l + 1 == r && sorted[l] <= x;
    }
    long long ltl = (l != seg[idx].l ? left[d][l - 1] : 0);
    long long tl = left[d][r - 1] - ltl;
    long long mid = seg[idx].mid;
    if (x < sorted[mid]) {
      long long newl = seg[idx].l + ltl;
      long long newr = seg[idx].l + ltl + tl;
      return rank(newl, newr, x, d + 1, idx << 1);
    } else {
      long long tr = r - l - tl;
      long long ltr = l - seg[idx].l - ltl;
      long long newl = mid + ltr;
      long long newr = mid + ltr + tr;
      return tl + rank(newl, newr, x, d + 1, idx << 1 | 1);
    }
  }
  long long freq(long long l, long long r, long long x) {
    return rank(l, r, x) - rank(l, r, x - 1);
  }
} kth;
int main(void) {
  long long NN, K, Q;
  cin >> NN >> K >> Q;
  for (long long i = 0; i < NN; i++) {
    cin >> A[i];
  }
  kth.init(A, NN);
  long long kouho = INT_MAX;
  for (long long i = 0; i < NN; i++) {
    for (long long j = i; j < NN; j++) {
      long long len = j - i + 1;
      if (Q <= len - K + 1) {
        long long aa = kth.kth(i, j + 1, Q) - kth.kth(i, j + 1, 1);
        kouho = min(aa, kouho);
      } else {
        continue;
      }
    }
  }
  cout << kouho << endl;
}
