#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int N, W; bool checked[1 << 13]; ll dfs(int i, int w, vector &A, int mask) { ll cnt = 0; if (w > W) return 0; if (w == W && mask > 0) { if (not checked[mask]) { checked[mask] = true; cnt += 1; } } if (i == N) return cnt; cnt += dfs(i + 1, w, A, mask); cnt += dfs(i + 1, w + A[i], A, mask | (1 << i)); cnt += dfs(i + 1, w + A[i] / 2, A, mask | (1 << i)); return cnt; } int main() { memset(checked, false, sizeof(checked)); cin >> N >> W; vector A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; } int mask = 0; cout << dfs(0, 0, A, mask) << endl; return 0; }