#include <bits/stdc++.h>
using namespace std;
struct segment_tree {
  const long INF = 2 * 1e9;
  long n = 1;
  long data[10000];
  segment_tree(int a) {
    while (n < a) n *= 2;
    for (int i = 0; i < 2 * n; i++) data[i] = INF;
  }
  long nreturn() { return n; }
  void change(long k, long a) {
    k += n - 1;
    data[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      data[k] = min(data[2 * k + 1], data[2 * k + 2]);
    }
    return;
  }
  long rmq(long a, long b, long k, long l, long r) {
    if (a >= r || b <= l) return INF;
    if (a <= l && b >= r) return data[k];
    long teml = rmq(a, b, 2 * k + 1, l, (l + r) / 2);
    long temr = rmq(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(teml, temr);
  }
};
int main() {
  int nn, k, q;
  cin >> nn >> k >> q;
  segment_tree tree(nn);
  int n = tree.nreturn();
  long a;
  for (int i = 0; i < nn; i++) {
    cin >> a;
    tree.change(i, a);
  }
  long tem = tree.INF;
  long tem2, temm;
  temm = 0;
  set<long> st;
  for (int i = 0; i < q; i++) {
    for (int j = 0; j < nn - k + 1 - i; j++) {
      if (abs(tem - temm) > abs(tree.rmq(j, j + k, 0, 0, n) - temm))
        tem = tree.rmq(j, j + k, 0, 0, n);
    }
    st.insert(tem);
    for (int j = 0; j < nn - i; j++) {
      if (tree.data[j + n - 1] == tem) {
        tem2 = j;
        break;
      }
    }
    for (int j = tem2; j <= nn - i - 2; j++) {
      tree.change(j, tree.data[j + n]);
    }
    tree.change(nn - i - 1, tree.INF);
    tem = tree.INF;
    temm = *st.begin();
  }
  auto itr = st.end();
  itr--;
  long ans = *itr - *st.begin();
  cout << ans << endl;
}
