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.util.*;
import java.io.*;

public class b {
  
  public static void main (String[] args){
    
    //settingup input and output
    Scanner in = null;
    PrintWriter out = null;
    try{
      in = new Scanner(new File("bsmall.txt"));
      out = new PrintWriter(new FileOutputStream("bsmallout.txt"), true);
    }catch(Exception e){
      System.out.println("file not found");
    }
    
    // number of cases
    int n = in.nextInt(); 
    in.nextLine();
    
    // run through each case
    for(int currentCase = 1; currentCase <= n; currentCase++){
      
      int result = 0;
      int N = in.nextInt(); // number of Googlers
      int S = in.nextInt(); // number of surprising triplets
      int p = in.nextInt(); // must be >= p to be considered
      int t[] = new int[N]; // total point for each Googler
      for(int i = 0; i < N; i++){
        t[i] = in.nextInt();
      }
      
      for(int i = 0; i < N; i++){
        if(t[i] >= (p*3 - 2)) result++; // automatically pass
        else if((S > 0) && ((((p*3 - 3) > 0) && (t[i] == (p*3 - 3)))  
                              || (((p*3 - 4) > 0) && (t[i] == (p*3 - 4))))){
          result++;
          S--; // consumes a quota of surprising triplet to pass
        }
      }
      
      //output answers for each case
      out.println("Case #" + currentCase + ": " + result);
    }
    
    // close input and output streams
    in.close();
    out.close();
  } 
}