#include <bits/stdc++.h>
using namespace std;
int debug_num = 0;
const int maxn = 2010;
int n, k, q;
long long a[maxn];
long long b[maxn];
bool check(long long limit) {
  for (int i = 1; i <= n; ++i) b[i] = a[i];
  sort(b + 1, b + n + 1);
  long long maxx = 1ll << 60;
  for (int i = 1; i + k - 1 <= n; ++i) {
    maxx = min(maxx, b[i + k - 1] - b[i]);
  }
  if (maxx <= limit)
    return 1;
  else
    return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long l = -1, r = 1e9;
  while (r - l > 1) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return 0;
}
