题面
Given a set of numbers, the partition problem is to find a subset of the numbers that add up to a specific target number. For example, there are two ways to partition the set so that the remaining elements add up to :
- Select the and the
- Select just the
By contrast, there is no way to partition the set to get .
Write a program that enters a target number, and then several integers as elements of the set, and print number of partitions.
For example, print if are entered (all integers are separated by a blank), and print if are entered.
样例
输入
5 1 3 4 5
输出
2
输入
11 1 3 4 5
输出
0