1857: 数字组合

Memory Limit:256 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

有n个正整数,找出其中和为t(t也是正整数)的可能的组合方式。如:
n=5,5个数分别为1,2,3,4,5,t=5;
那么可能的组合有5=1+4和5=2+3和5=5三种组合方式。

Input

输入的第一行是两个正整数n和t,用空格隔开,其中1≤n≤20,表示正整数的个数,t为要求的和(1≤t≤1000);

接下来的一行是n个正整数,用空格隔开。

Output

和为t的不同的组合方式的数目。

Sample Input Copy

5 5
1 2 3 4 5

Sample Output Copy

3

Source/Category