import java.util.*;
public class Test {
  public static void main(String[] args){
    Scanner in = new Scanner(System.in);
    int T = in.nextInt();

    for(int i = 1; i<=T; i++) {
      int n = in.nextInt();
      int s = in.nextInt();
      int p = in.nextInt();
      int result = 0;
      for(int j = 0; j<n; j++){
        int x = canAddUp(in.nextInt(), p);
        if(x == 0) {
          result++;
        } else if (x==1 && s > 0) {
          result++;
          s--;
        }
      }
      System.out.println("Case #"+i+": "+result);
    }
  }

  public static int canAddUp(int sum, int limit) {
    boolean flag = false;
    for(int i = 0; i<=sum; i++) {
      for(int j = 0; i+j <= sum; j++) {
        int k = sum-(i+j);
        int a = Math.abs(i-j);
        int b = Math.abs(i-k);
        int c = Math.abs(j-k);
        if(a > 2 || b > 2 || c> 2){
          continue;
        }

        if (i>=limit || j>=limit || k>=limit) {
          if(a < 2 && b < 2 && c < 2) {
            return 0;
          }else{
            flag = true;
          }
        }
      }
    }
    return (flag) ? 1 : 2;
  }
}

import java.io.*;
public class Q2 {

	/**
	 * @param args
	 * @throws Throwable 
	 */
	public static void main(String[] args) throws Throwable {
		BufferedReader br = new BufferedReader(new FileReader("a-small.in"));
		PrintWriter pr = new PrintWriter(new FileWriter("output.txt"));
		
		int T = Integer.parseInt(br.readLine());
		
		for(int cas = 1; cas<=T; cas++)
		{
			String[] input = br.readLine().split(" ");
			int N = Integer.parseInt(input[0]);
			int S = Integer.parseInt(input[1]);
			int p = Integer.parseInt(input[2]);
			int score = 0;
			
			int normalMin = p + 2*(p-1);
			int sMin = p + 2*(p-2);
			
			if(p == 0)
			{
				normalMin = 0;
				sMin = 0;
			}
			else if(p == 1)
			{
				normalMin = 1;
				sMin = 1;
			}
			
			for(int person = 0; person<N;person++)
			{
				int total = Integer.parseInt(input[person+3]);
 				
				if(total >= normalMin)
				{
					score++;
				}
				else if(total >= sMin && S > 0)
				{
					score++;
					S--;
				}
			}
			
			pr.println("Case #" + cas + ": " + score);
		}
		
		pr.close();
	}

}
