#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  int ans = INF;
  for (int i = 0; i < (n); ++i) {
    int l = -1;
    int r = 1e9;
    int mid = (l + r) / 2;
    while (r - l > 1) {
      mid = (l + r) / 2;
      int count = 0;
      for (int j = 0; j < (n); ++j) {
        if (a[i] <= a[j] && a[j] <= a[i] + mid) {
          count++;
        }
      }
      if (count >= q)
        r = mid;
      else
        l = mid;
    }
    ans = min(ans, r);
  }
  cout << ans << endl;
  return 0;
}
