#include <bits/stdc++.h>
using namespace std;
int a[3005], b[3005];
int n, K, Q, ans;
bool vis[3005], ok[3005];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  scanf("%d%d%d", &n, &K, &Q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), b[i] = i, ok[i] = 1;
  sort(b + 1, b + n + 1, cmp);
  int j = 1;
  ans = a[b[Q]] - a[b[1]];
  for (int i = Q + 1, last; i <= n; i = last + 1) {
    last = i;
    vis[b[i]] = 1;
    while (last < n && a[b[last + 1]] == a[b[i]]) last++, vis[b[last]] = 1;
    while (j < last - Q + 1) {
      vis[b[j]] = 0;
      ok[b[j]] = 0;
      j++;
    }
    int x = 1, y, num = 0, zm = 0;
    while (x <= n) {
      if (!ok[x]) x++;
      y = x;
      while (y < n && ok[y]) y++;
      zm = 0;
      for (int k = x; k <= y; k++)
        if (vis[k]) zm++;
      num += min(zm, max((y - x + 1) - (K - 1), 0));
      x = y + 1;
    }
    if (num == Q) ans = min(ans, a[b[last]] - a[b[last - Q + 1]]);
  }
  cout << ans << endl;
}
