#include #define FastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; void solve() { int n, m, x, y; cin >> n >> m >> x >> y; vector must, other; rep(_, n) { int tbeet; cin >> tbeet; if (tbeet >= x) { must.emplace_back(tbeet); } else if (tbeet <= y) { // ignore } else { other.emplace_back(tbeet); } } if ((int)must.size() >= m) { cout << "Handicapped" << '\n'; return; } sort(other.begin(), other.end()); reverse(other.begin(), other.end()); int ans = 0; for (const auto m : must) ans += m; rep(i, min(m - must.size(), other.size())) { ans += other[i]; } cout << ans << '\n'; } int main() { FastIO; solve(); return 0; }