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

public class DanceGooglers {
	static String name = "B-large";

	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new FileReader(name + ".in"));
		PrintWriter out = new PrintWriter(name + ".out");
		int t = Integer.parseInt(in.readLine()), caseN = 1;
		while (caseN <= t) {
			int ans = 0;
			StringTokenizer tok = new StringTokenizer(in.readLine());
			int n = Integer.parseInt(tok.nextToken()), s = Integer.parseInt(tok
					.nextToken()), p = Integer.parseInt(tok.nextToken());

//			System.out.println(n + " " + s + " " + p);
			for (int i = 0; i < n; i++) {
				int total = Integer.parseInt(tok.nextToken());
//				System.out.println(total);
				if (total < p)
					continue;
				
				if (total >= p * 3 - 2) {
					ans++;
					continue;
				}

				if (total >= p * 3 - 4 && s > 0) {
					s--;
					ans++;
				}
			}
			out.print("Case #");
			out.print(caseN++);
			out.print(": ");
			out.println(ans);
//			System.out.println(caseN - 1 + " ans " + ans);
		}
		out.flush();
	}
}