import java.util.Scanner;
import java.io.*;
class dance
{
  public static void main (String[] args) throws IOException
  { 
    File    inputData = new File("B-small-attempt0.in");
	File 	outputData= new File("Boutput.txt");
    Scanner scan = new Scanner( inputData );
	PrintStream print= new PrintStream(outputData);
    
	int t;
	int n,s,p,pi;
	t= scan.nextInt();
	for(int i=1;i<=t;i++)
	{
	n=scan.nextInt();	s=scan.nextInt();	p=scan.nextInt();
	int supTrip=0, notsupTrip=0;
	
	for(int j=0;j<n;j++)
	{
		pi=scan.nextInt();
		if(pi>(3*p-3))
		notsupTrip++;
		else if((pi>=(3*p-4))&&(pi<=(3*p-3))&&(pi>p))
		supTrip++;
	}
	
	if(s<=supTrip)
	notsupTrip=notsupTrip+s;
	else if(s>supTrip)
	notsupTrip= notsupTrip+supTrip;
	print.println("Case #"+i+": "+notsupTrip);
	}
  }
}
import java.io.IOException;
import java.util.Scanner;

public class DancingWithTheGooglers {
	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();

		int counter = 1;
		while (T-- > 0) {
			int returned = 0;
			int N = scan.nextInt();
			int surp = scan.nextInt();
			int theMax = scan.nextInt();
			double[] array = new double[N];
			for (int i = 0; i < array.length; i++) {
				array[i] = scan.nextDouble();
			}
			for (int i = 0; i < array.length; i++) {
				if (Math.ceil((double) array[i] / 3) >= theMax) {
					returned++;
				} else if (array[i] >= theMax) {
					double temp = array[i] - theMax;
					double first = theMax;
					double second = Math.ceil((double) temp / 2);
					double third = temp - second;

					double diff1 = Math.abs(first - second);
					double diff2 = Math.abs(second - third);
					double diff3 = Math.abs(first - third);

					if (diff1 <= 2 && diff2 <= 2 && diff3 <= 2) {
						if (diff1 == 2 || diff2 == 2 || diff3 == 2) {
							if (surp > 0
									&& (first >= theMax || second >= theMax || third >= theMax)) {
								surp--;
								returned++;
							}
						}
					}
				}
			}
			System.out.println("Case #" + counter++ + ": " + returned);
		}
	}
}