#include <bits/stdc++.h>
using namespace std;
const int MAX = 2005;
long long N, K, Q, dp[MAX][MAX], rmp[MAX];
pair<long long, long long> A[MAX];
map<long long, long long> mp;
struct Node {
  int val;
  Node *l, *r;
  Node(int val, Node *l, Node *r) : val(val), l(l), r(r) {}
  Node *update(int pos, int x, int y) {
    if (pos < x || pos > y) return this;
    if (x == y) {
      return new Node(val + 1, NULL, NULL);
    }
    int mid = (x + y) / 2;
    return new Node(val + 1, l->update(pos, x, mid),
                    r->update(pos, mid + 1, y));
  }
} * seg[100005];
int query(Node *le, Node *ri, int x, int y, int k) {
  if (x == y) return x;
  int mid = (x + y) / 2;
  int cnt = ri->l->val - le->l->val;
  if (cnt >= k) return query(le->l, ri->l, x, mid, k);
  return query(le->r, ri->r, mid + 1, y, k - cnt);
}
long long func(int l, int r, int dep) {
  if (l > r) return 1e18;
  if (dep == Q - 1) {
    return rmp[query(seg[l - 1], seg[r], 1, N, Q)] -
           rmp[query(seg[l - 1], seg[r], 1, N, 1)];
  }
  long long &ret = dp[l][r];
  if (ret != -1) return ret;
  ret = 1e18;
  if (1 <= l - 1) ret = min(ret, func(l - 1, r, dep + 1));
  if (r + 1 <= N) ret = min(ret, func(l, r + 1, dep + 1));
  return ret;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%lld %lld %lld", &N, &K, &Q);
  seg[0] = new Node(0, NULL, NULL);
  seg[0]->l = seg[0]->r = seg[0];
  for (int i = 1; i <= N; i++) {
    scanf("%lld", &A[i].first);
    A[i].second = i;
  }
  sort(A + 1, A + N + 1);
  for (int i = 1; i <= N; i++) {
    mp[A[i].second] = i;
    rmp[i] = A[i].first;
  }
  for (int i = 1; i <= N; i++) {
    seg[i] = seg[i - 1]->update(mp[i], 1, N);
  }
  long long ans = 1e18;
  for (int i = 1; i + K - 1 <= N; i++) {
    ans = min(ans, func(i, i + K - 1, 0));
  }
  printf("%lld\n", ans);
  return 0;
}
