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);
	}
  }
}
package com.renoux.gael.codejam.utils;

import java.io.Closeable;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;


public class Output implements Closeable {

    private static String lineSeparator = System.getProperty("line.separator");

    private FileWriter writer;


    private Output(File file) {
        try {
            writer = new FileWriter(file);
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

    public static Output open(File file) {
        System.out.println("======== " + file);
        return new Output(file);
    }

    public void writeLine(String text) {
        System.out.println(text);
        try {
            writer.write(text);
            writer.write(lineSeparator);
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

    public void write(String text) {
        System.out.print(text);
        try {
            writer.write(text);
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

    public void writeLine(Object... text) {
        try {
            for (Object s : text) {
                System.out.print(s);
                writer.write(s.toString());
            }
            System.out.println();
            writer.write(lineSeparator);
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

    public void write(Object... text) {
        try {
            for (Object s : text) {
                System.out.print(s);
                writer.write(s.toString());
            }
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

    public void close() {
        System.out.println("================ closed");
        try {
            writer.close();
        } catch (IOException e) {
            throw new TechnicalException(e);
        }
    }

}
