#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1000000007LL;
ll A[2000];
int main() {
	ll N, K, Q;
	cin >> N >> K >> Q;
	ll ma = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		ma = max(ma, A[i]);
	}
	ll ans = 1 << 30;
	for (int i = 0; i < N; i++) {
		ll l = A[i] - 1, r = ma + 1;
		bool ok = 0;
		while (r - l > 1) {
			ll m = (l + r) / 2;
			ll cnt = 0;
			ll len = 0;
			ll sum = 0;
			for (int j = 0; j < N; j++) {
				if (A[j] < A[i]) {
					sum += min(cnt, max(len - K + 1, 0LL));
					len = 0;
					cnt = 0;
				}
				else {
					len++;
					if (A[j] <= m) cnt++;
				}
			}
			sum += min(cnt, max(len - K + 1, 0LL));
			if (sum >= Q) r = m, ok = 1;
			else l = m;
		}
		if (ok) ans = min(ans, r - A[i]);
	}
	cout << ans << endl;
}