import java.util.*;

public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        B th = new B();
        for (int i = 0; i < T; i++) {
            int n = sc.nextInt();
            int s = sc.nextInt();
            int p = sc.nextInt();
            int[] t = new int[n];
            for (int j = 0; j < n; j++) {
                t[j] = sc.nextInt();
            }
            int c = th.getAnswer(s,p,t);
            System.out.println("Case #" + (i+1) + ": " + c);
        }
    }
    public int getAnswer(int s, int p, int[] t) {
        int A1 = p + p-1+p-1;
        int A2 = p + p-2+p-2;
        if (A1 < 0)
            A1 = 0;
        if (A2 < 0)
            A2 = 1;
        int remain = s;
        int count = 0;
        int n = t.length;
        for (int i = 0; i < n; i++) {
            if (t[i] >= A1) {
                count++;
            } else if (t[i] < A1 && t[i] >= A2) {
                if (remain > 0) {
                    remain--;
                    count++;
                }
            }
        }
        return count;
    }
}


import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;

public class SurpScores {
	
	public int count(int[] scores, int p, int surprises) {
		int countSurp = 0;
		int countNonSurp = 0;
		int minSurpScore = p + (p-2) + (p-2);
		int minNonSurpScore = minSurpScore + 2;
		if(p < 2) {
			minSurpScore = minNonSurpScore = p; 
		}
		
		for(int i = 0; i < scores.length; i++) {
			if(scores[i] >= minNonSurpScore) countNonSurp++;
			else if(scores[i] >= minSurpScore) countSurp++;
		}
		
		return countNonSurp + Math.min(surprises, countSurp);
	}
	
	
	public static void main(String args[]) {
		SurpScores c = new SurpScores();
		String result[] = null;
		
		
		try {
			Scanner sc = new Scanner(new FileInputStream("C:/Users/Administrator/Downloads/B-large.in"));
			String line = sc.nextLine().trim();
			int cases = Integer.parseInt(line);
			result = new String[cases];
			for(int i = 0; i < cases; i++) {
				line = sc.nextLine().trim();
				String temp[] = line.split(" ");
				int players = Integer.parseInt(temp[0]);
				int surprises = Integer.parseInt(temp[1]);
				int p = Integer.parseInt(temp[2]);
				int scores[] = new int[players];
				
				for(int j = 0; j < players; j++) {
					scores[j] = Integer.parseInt(temp[j + 3]);
				}
				result[i] = "Case #" + (i+1) + ": " + c.count(scores, p, surprises);
			}
			
		} catch(Exception e) {
			e.printStackTrace();
		}
		
		try {
			 FileWriter fstream = new FileWriter("C:/out.txt");
			 PrintWriter out = new PrintWriter(fstream);
			 
			 for(int i = 0; i < result.length; i++) {
				 out.println(result[i]);
			 }
			 out.close();
		}catch(Exception e) {
			e.printStackTrace();
		}
	}
}
