#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
constexpr ll INF = 1LL << 62;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(N);
  for (auto&& a : A) {
    cin >> a;
  }
  ll X = -1;
  ll Y = INF;
  for (ll q = 0; q < Q; q++) {
    vector<ll> backet(N - q, 0);
    for (ll i = 0; i < N - q - K + 1; i++) {
      ll mini = INF;
      ll idx = -1;
      for (ll k = 0; k < K; k++) {
        if (mini > A[i + k]) {
          mini = A[i + k];
          idx = i + k;
        }
      }
      backet[idx]++;
    }
    vector<ll> candidates;
    for (ll i = 0; i < N - q; i++) {
      if (backet[i] != 0) {
        candidates.push_back(i);
      }
    }
    if (Q - q <= candidates.size()) {
      sort(candidates.begin(), candidates.end(),
           [A](ll l, ll r) { return A[l] < A[r]; });
      ll idx = -1;
      ll D = INF;
      for (ll i = 0; i < candidates.size() - (Q - q) + 1; i++) {
        ll mini = INF;
        ll maxi = -1;
        for (ll k = 0; k < Q - q; k++) {
          mini = min(mini, A[candidates[k]]);
          maxi = max(maxi, A[candidates[k]]);
        }
        ll d;
        if (X != -1) {
          d = max(Y - mini, 0LL) + max(maxi - X, 0LL);
        } else {
          d = maxi - mini;
        }
        if (d < D) {
          idx = i;
          D = d;
        }
      }
      if (X != -1) {
        cout << X - Y + D << endl;
      } else {
        cout << D << endl;
      }
      return 0;
    }
    ll remove_idx = -1;
    ll max_num = -1;
    for (ll i = 0; i < N - q; i++) {
      if (backet[i] > 1 && A[i] > max_num) {
        remove_idx = i;
        max_num = A[i];
      }
    }
    X = max(X, A[remove_idx]);
    Y = min(Y, A[remove_idx]);
    A.erase(A.begin() + remove_idx);
  }
  cout << X - Y << endl;
  return 0;
}
