#include <bits/stdc++.h>
using namespace std;
class segment_tree {
 private:
  static const int MAX_N = 1 << 18;
  int num;
  pair<int, int> dat[2 * MAX_N - 1];
  static const int INI = 2e9;
  pair<int, int> op(pair<int, int> a, pair<int, int> b) { return min(a, b); }

 public:
  segment_tree(int n_) {
    if (n_ > MAX_N) cerr << "INVALID INPUT" << endl;
    num = 1;
    while (num < n_) num *= 2;
    for (int i = 0; i < 2 * num - 1; i++) dat[i] = {INI, -1};
  }
  void update(int k, pair<int, int> a) {
    k += num - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = op(dat[2 * k + 1], dat[2 * k + 2]);
    }
  }
  pair<int, int> getval(int a, int b, int k = 0, int left = 0, int right = -1) {
    if (right < 0) right = num;
    if (right <= a || b <= left) return {INI, -1};
    if (a <= left && right <= b) return dat[k];
    auto vleft = getval(a, b, 2 * k + 1, left, left + (right - left) / 2);
    auto vright = getval(a, b, 2 * k + 2, left + (right - left) / 2, right);
    return op(vleft, vright);
  }
};
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> a(N), c(N, 1e9);
  segment_tree seg(N);
  auto seg_init = seg;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    seg.update(i, {a[i], i});
  }
  for (int i = 0; i < N; i++) {
    int cnt = 0;
    for (int j = i + K; j <= N; j++) {
      cnt++;
      auto p = seg.getval(i, j);
      int pos = p.second;
      c[pos] = min(c[pos], cnt);
      seg.update(pos, {2e9, -1});
    }
    seg = seg_init;
  }
  int ans = 1e9;
  for (int i = 0; i < N; i++) {
    for (int j = j + 1; j < N; j++) {
      if (max(c[i], c[j]) > K) continue;
      ans = min(ans, abs(a[i] - a[j]));
    }
  }
  cout << ans << endl;
  return 0;
}
