完全背包 DP就是短
f[i] += f[i-c[i]];
/*
ID: your_id_here
PROG: money
LANG: C++
*/
#include <iostream>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
using namespace std;
long long f[10005];
int c[30];
int main()
{
freopen("money.in","r",stdin);
freopen("money.out","w",stdout);
int i,j,v,n;
cin>>n>>v;
for(i = 1; i <= n ; i++)
cin>>c[i];
f[0] = 1;
for(i = 1 ; i <= n ; i++)
for(j = c[i] ; j <= v ; j++)
f[j] += f[j-c[i]];
cout<<f[v]<<endl;
fclose(stdin);
fclose(stdout);
return 0;
}