#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cassert>
using namespace std;
int main()
{
int tc,n,s,p,t;
int i,j,k,count=0;
scanf("%d",&tc);
for(i=0;i<tc;i++)
{
count=0;
scanf("%d%d%d",&n,&s,&p);
for(j=0;j<n;j++)
{
scanf("%d",&t);
if(t/3>=p)
count++;
else
{
k=t-p;
if( k>=(2*p-2) && k>=0 && p>0)
count++;
else if(k>=(2*p-4) && s>0 && k>=0 && p>0)
{
count++;
s--;
}
}
}
printf("Case #%d: %d\n",i+1,count);
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CQojaW5jbHVkZTx2ZWN0b3I+CiNpbmNsdWRlPHNldD4KI2luY2x1ZGU8bWFwPgojaW5jbHVkZTxxdWV1ZT4KI2luY2x1ZGU8c3RhY2s+CiNpbmNsdWRlPHN0cmluZz4KI2luY2x1ZGU8YWxnb3JpdGhtPgojaW5jbHVkZTxmdW5jdGlvbmFsPgojaW5jbHVkZTxpb21hbmlwPgojaW5jbHVkZTxjc3RkaW8+CiNpbmNsdWRlPGNtYXRoPgojaW5jbHVkZTxjc3RyaW5nPgojaW5jbHVkZTxjc3RkbGliPgojaW5jbHVkZTxjYXNzZXJ0Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmludCBtYWluKCkKewoJaW50IHRjLG4scyxwLHQ7CglpbnQgaSxqLGssY291bnQ9MDsKCXNjYW5mKCIlZCIsJnRjKTsKCWZvcihpPTA7aTx0YztpKyspCgl7CgkJY291bnQ9MDsKCQlzY2FuZigiJWQlZCVkIiwmbiwmcywmcCk7CgkJZm9yKGo9MDtqPG47aisrKQoJCXsJCgkJCXNjYW5mKCIlZCIsJnQpOwoJCQlpZih0LzM+PXApCgkJCQljb3VudCsrOwoJCQllbHNlCgkJCXsKCQkJCWs9dC1wOwoJCQkJaWYoIGs+PSgyKnAtMikgJiYgaz49MCAmJiBwPjApCgkJCQkJY291bnQrKzsKCQkJCWVsc2UgaWYoaz49KDIqcC00KSAmJiBzPjAgJiYgaz49MCAmJiBwPjApCgkJCQl7CgkJCQkJY291bnQrKzsKCQkJCQlzLS07CgkJCQl9CgkJCX0KCQl9CgkJcHJpbnRmKCJDYXNlICMlZDogJWRcbiIsaSsxLGNvdW50KTsKCX0KCXJldHVybiAwOwp9Cg==