/*
ID: untamed
PROG: COINCHANGE2
LANG: C++
*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<limits>
#include<climits>
#include<cmath>
#include<functional>
#include<ctime>
#include<cstdlib>
#include<fstream>
#include<typeinfo>
const int ONE = 1<<10;
const int TWO = 1<<11;
const int FOUR = 1<<12;
const int EIGHT = 1<<13;
const int SIXTEEN = 1<<14;
const int THIRTY = 1<<15;
const int SIXTY = 1<<16;
const int ONE_HUNDRED = 1<<17;
const int TWO_HUNDRED = 1<<18;
const int FIVE_HUNDRED = 1<<19;
const int MILLION = 1<<20;
using namespace std;
typedef long long int ll;
typedef short int i16;
typedef unsigned long long int u64;
typedef unsigned int u32;
typedef unsigned short int u16;
typedef unsigned char u8;
const int MOD = 100000007;
int n,k;
int a[128];
void input()
{
scanf("%d %d", &n, &k);
for(int i=1;i<=n;i++)
{
scanf("%d", &a[i]);
}
}
bool used[128][SIXTEEN];
int state[128][SIXTEEN];
int recurse(int current_coin, int k_now)
{
if(k_now<0)
return 0;
if(k_now==0)
return 1;
if(current_coin>n)
return 0;
if(used[current_coin][k_now])
return state[current_coin][k_now];
int ans;
ans=(recurse(current_coin+1,k_now)+recurse(current_coin,k_now-a[current_coin]))%MOD;
used[current_coin][k_now]=true;
state[current_coin][k_now]=ans;
return ans;
}
void solve()
{
printf("%d\n", recurse(1,k));
}
int main()
{
int i,t;
scanf("%d", &t);
for(i=1;i<=t;i++)
{
memset(used,0,sizeof(used));
input();
printf("Case %d: ", i);
solve();
}
return 0;
}
LyoKSUQ6IHVudGFtZWQKUFJPRzogQ09JTkNIQU5HRTIKTEFORzogQysrCiovCiAKI2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxpb3N0cmVhbT4KI2luY2x1ZGU8YWxnb3JpdGhtPgojaW5jbHVkZTxzdHJpbmc+CiNpbmNsdWRlPGNzdHJpbmc+CiNpbmNsdWRlP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AmbiwgJmspOwogICAgZm9yKGludCBpPTE7aTw9bjtpKyspCiAgICB7CiAgICAgICAgc2NhbmYoIiVkIiwgJmFbaV0pOwogICAgfQp9CiAKYm9vbCB1c2VkWzEyOF1bU0lYVEVFTl07CmludCBzdGF0ZVsxMjhdW1NJWFRFRU5dOwogCmludCByZWN1cnNlKGludCBjdXJyZW50X2NvaW4sIGludCBrX25vdykKewogICAgaWYoa19ub3c8MCkKICAgICAgICByZXR1cm4gMDsKICAgIGlmKGtfbm93PT0wKQogICAgICAgIHJldHVybiAxOwogICAgaWYoY3VycmVudF9jb2luPm4pCiAgICAgICAgcmV0dXJuIDA7CiAgICBpZih1c2VkW2N1cnJlbnRfY29pbl1ba19ub3ddKQogICAgICAgIHJldHVybiBzdGF0ZVtjdXJyZW50X2NvaW5dW2tfbm93XTsKICAgIGludCBhbnM7CiAgICBhbnM9KHJlY3Vyc2UoY3VycmVudF9jb2luKzEsa19ub3cpK3JlY3Vyc2UoY3VycmVudF9jb2luLGtfbm93LWFbY3VycmVudF9jb2luXSkpJU1PRDsKICAgIHVzZWRbY3VycmVudF9jb2luXVtrX25vd109dHJ1ZTsKICAgIHN0YXRlW2N1cnJlbnRfY29pbl1ba19ub3ddPWFuczsKICAgIHJldHVybiBhbnM7Cn0KIAp2b2lkIHNvbHZlKCkKewogICAgcHJpbnRmKCIlZFxuIiwgcmVjdXJzZSgxLGspKTsKfQogCmludCBtYWluKCkKewogICAgaW50IGksdDsKICAgIHNjYW5mKCIlZCIsICZ0KTsKICAgIGZvcihpPTE7aTw9dDtpKyspCiAgICB7CiAgICAgICAgbWVtc2V0KHVzZWQsMCxzaXplb2YodXNlZCkpOwogICAgICAgIGlucHV0KCk7CiAgICAgICAgcHJpbnRmKCJDYXNlICVkOiAiLCBpKTsKICAgICAgICBzb2x2ZSgpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=