#include using namespace std; #define rep(i, n) for(ll i = 0; i < ll(n); i++) using ll = long long; using P = pair; ll zero = 3000; // dp[i][j][k] = 品物iまで見てj個購入して総和がk(-zero)の通り数 ll dp[55][55][6300]; // 6 3 6 2 4 // 2 2 3 5 1 1 // 2 -2 // newa = {x-2, x-2, -1, 1, x-3, x-3} int main() { cin.tie(0); ios_base::sync_with_stdio(false); ll n, m, x, y, z; cin >> n >> m >> x >> y >> z; vector a(n); rep(i, n) cin >> a[i]; x -= z, y -= z; rep(i, n) a[i] -= z; ll sum = 0, cnt = 0; vector think; rep(i, n) { if (a[i] >= x) { sum += a[i]; cnt++; } else if (a[i] > y) { think.push_back(a[i]); } } if(cnt > m) { cout << "Handicapped" << endl; return 0; } dp[0][0][sum + zero] = 1; rep(i, think.size()) { rep(j, m - cnt + 1) { rep(k, zero * 2) { dp[i + 1][j][k] += dp[i][j][k]; if(j != m - cnt && 0 <= k + think[i] && k + think[i] < zero * 2) { dp[i + 1][j + 1][k + think[i]] += dp[i][j][k]; } } } } ll ans = 0; rep(i, m - cnt + 1) { if (i == 0) { if(cnt != 0) ans += dp[think.size()][i][zero]; } else ans += dp[think.size()][i][zero]; } cout << ans << endl; }