// Finally WSL
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
#define all(x) (x).begin(), (x).end()
#define isz(x) (int)x.size()
#define int long long
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void run(int tc) {
int n, p, q;
cin >> n >> p >> q;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
cin >> a[i];
sort(a.begin() + 1, a.end());
int low = 1, high = 1e18, best = 1e18;
auto check = [&](int w) -> bool {
vector<array<int, 2>> group;
for (int i = 1; i <= n;) {
auto it = upper_bound(a.begin() + i, a.end(), a[i] + w - 1);
if (it != a.end()) {
debug(w, a[i], *(it - 1));
group.push_back({a[i], *(it - 1)});
i = it - a.begin();
} else {
debug(w, a[i], a[n]);
group.push_back({a[i], a[n]});
i = n + 1;
}
}
int cntSmall = group.size(), cntBig = 0;
if (cntSmall <= p)
return true;
assert(1 <= cntSmall && cntSmall <= n);
debug(cntSmall);
for (int i = 0; i < group.size() - 1; i++) {
auto [l1, r1] = group[i];
auto [l2, r2] = group[i + 1];
assert(r1 <= l2);
if ((r2 - l1 + 1) <= 2 * w) {
cntBig++;
cntSmall -= 2;
i++;
}
debug(l1, l2, r1, r2, cntBig, cntSmall);
if (cntBig <= q && cntSmall <= p) return true;
}
return false;
};
while (low <= high) {
int mid = (low + high) >> 1;
if (check(mid)) {
high = mid - 1;
best = mid;
} else {
low = mid + 1;
}
}
cout << best << endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
for (int tc = 1; tc <= t; tc++) run(tc);
}