#include<bits/stdc++.h>
#define mod 100000007
using namespace std;
typedef long long ll;
ll arr[10009],coin[1000];
int main()
{
ll i,j,k,l,m,n,test,make;
cin>>test;
for(k=1;k<=test;k++)
{
cin>>n>>make;
memset(arr,0,sizeof(arr));
for(i=1;i<=n;i++)
{
cin>>coin[i];
}
arr[0]=1;
ll sum=0;
for(i=1;i<=n;i++)
{
for(j=coin[i];j<=make;j++)
{
arr[j]=(arr[j]%mod)+(arr[j-coin[i]]%mod);
}
}
cout<<"Case "<<k<<": "<<arr[make]%mod<<endl;
}
return 0;
}
#define mod 100000007
using namespace std;
typedef long long ll;
ll arr[10009],coin[1000];
int main()
{
ll i,j,k,l,m,n,test,make;
cin>>test;
for(k=1;k<=test;k++)
{
cin>>n>>make;
memset(arr,0,sizeof(arr));
for(i=1;i<=n;i++)
{
cin>>coin[i];
}
arr[0]=1;
ll sum=0;
for(i=1;i<=n;i++)
{
for(j=coin[i];j<=make;j++)
{
arr[j]=(arr[j]%mod)+(arr[j-coin[i]]%mod);
}
}
cout<<"Case "<<k<<": "<<arr[make]%mod<<endl;
}
return 0;
}
No comments:
Post a Comment