The boolean satisfiability problem is a famous problem in computer science. You are given
Note: the empty subset sums up to 0.
Input Specification
On the first line, there are two integers
On the second line is a space separated list of the
Each line is followed by one line feed character (ASCII code 0x0a).
There are no trailing spaces or empty lines.
Output Specification
One integer, the number of subsets that sum to less than or equal to
Constraints
For all subtasks:
For all subset sums,
Subtask 1 [2/15]
Subtask 2 [7/15]
Subtask 3 [6/15]
No additional constraints.
Sample Input 1
Copy
10 10
8 2 10 10 6 1 10 10 1 5
Sample Output 1
Copy
33
Sample Input 2
Copy
5 5
1 2 3 4 5
Sample Output 2
Copy
10
Comments