package codejam;

import fixjava.Pair;

public class Utils {

	public static long minLong(long firstVal, long... otherVals) {
		long minVal = firstVal;
		for (int i = 0; i < otherVals.length; i++)
			minVal = Math.min(firstVal, otherVals[i]);
		return minVal;
	}

	public static int minInt(int firstVal, int... otherVals) {
		int minVal = firstVal;
		for (int i = 0; i < otherVals.length; i++)
			minVal = Math.min(firstVal, otherVals[i]);
		return minVal;
	}

	public static float minFloat(float firstVal, float... otherVals) {
		float minVal = firstVal;
		for (int i = 0; i < otherVals.length; i++)
			minVal = Math.min(firstVal, otherVals[i]);
		return minVal;
	}

	/**
	 * ArgMin returned as a Pair<Integer, Integer>(index, value). Array must
	 * have at least one value.
	 */
	public static Pair<Integer, Integer> argMin(int[] arr) {
		int min = arr[0];
		int argMin = 0;
		for (int i = 1; i < arr.length; i++) {
			if (arr[i] < min) {
				min = arr[i];
				argMin = i;
			}
		}
		return new Pair<Integer, Integer>(argMin, min);
	}

	/**
	 * ArgMax returned as a Pair<Integer, Integer>(index, value). Array must
	 * have at least one value.
	 */
	public static Pair<Integer, Integer> argMax(int[] arr) {
		int max = arr[0];
		int argMax = 0;
		for (int i = 1; i < arr.length; i++) {
			if (arr[i] > max) {
				max = arr[i];
				argMax = i;
			}
		}
		return new Pair<Integer, Integer>(argMax, max);
	}

}

import java.util.Scanner;


public class Dancing {

	public static void main(String[] args) {

		int t, n, s, p, y;
		int[] ti;
		
		Scanner scan = new Scanner(System.in);
		
		t = scan.nextInt();
		
		for(int i=1; i<=t; i++){
			
			y = 0;
			int surprised = 0;
			
			n = scan.nextInt();
			s = scan.nextInt();
			p = scan.nextInt();
			
			ti = new int[n];
			
			for(int j=0; j<n; j++){
				ti[j] = scan.nextInt();
			}
			
			int limiteInf;
			
			if(p <= 1)
				limiteInf = p;
			else
				limiteInf = p + 2 * (p - 2);
			
			for(int j=0; j<ti.length; j++){
				
				if(limiteInf == 0){
					y++;
				}else if(ti[j] >= (limiteInf + 2)){
					y++;
					//System.out.println("Entrou 1: " + ti[j]);
				}else if(ti[j] >= limiteInf && ti[j] < (limiteInf + 2) && surprised < s){
					y++;
					surprised++;
					//System.out.println("Entrou 2: " + ti[j]);
				}
			}
			
			
			
			System.out.println("Case #" + i + ": " + y);
		}
	}

}
