package yukicoder; import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Collections; public class No1457 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int M = scan.nextInt(); int X = scan.nextInt(); int Y = scan.nextInt(); int Z = scan.nextInt(); List A = new ArrayList(); for (int i=0; i < N; i++) { A.add(scan.nextInt()); } scan.close(); Collections.sort(A); int remove = Collections.binarySearch(A, Y + 1); if (remove < 0) { remove = - remove - 1; } int remain = Collections.binarySearch(A, X); if (remain < 0) { remain = - remain - 1; } int remainN = N - remain; if (remainN > M) { System.out.println("Handicapped"); return; } int remainSum = A.subList(remain, N).stream().mapToInt(Integer::intValue).sum(); List select = A.subList(remove, remain); int min = remainN > 0 ? 0 : 1; int max = M - remainN; int n = remain - remove; int cnt = 0; for (int i = min; i < 1 << n; i++) { if (Integer.bitCount(i) <= max) { int sum = remainSum; int sumn = remainN; List s = new ArrayList(); for (int j = 0; j < n; j++) { if (((1 << j) & i) != 0) { sum += select.get(j); sumn++; s.add(select.get(j)); } } if (sum == Z * sumn) { cnt++; } } } System.out.println(cnt); } }