package util.graph;

import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;

public class DynDjikstra {
    public static State FindShortest(Node start, Node target) {
        PriorityQueue<Node> openSet = new PriorityQueue<>();
        Set<Node> closedSet = new HashSet<>();
        openSet.add(start);
        while (!openSet.isEmpty()) {
            Node current = openSet.poll();
            for (Edge edge : current.edges) {
                Node end = edge.target;
                if (closedSet.contains(end)) {
                    continue;
                }
                State newState = edge.travel(current.last);
                //if (end.equals(target)) {
                    //return newState;
                //}
                if (openSet.contains(end)) {
                    if (end.last.compareTo(newState)>0) {
                        end.last = newState;
                    }
                } else {
                    openSet.add(end);
                    end.last = newState;
                }
            }
            closedSet.add(current);
            if (closedSet.contains(target)) {
                return target.last;
            }
        }

        return target.last;
    }
}

import java.util.Scanner;


public class Two {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner (System.in);
		int cases=s.nextInt();
		for(int i=0;i<cases;i++){
			int total=0;
			int num=s.nextInt();
			int suprising=s.nextInt();
			int cutoff=s.nextInt();
			for(int j=0;j<num;j++){
				int par=s.nextInt();
				if(par>=cutoff+(cutoff-1)*2){
					total++;
				}
				else if(suprising>0 && par>=cutoff+Math.max(0, (cutoff-2)*2)){
					total++;
					suprising--;
					
				}
				else if(par<cutoff+(cutoff-2)*2)
					;
				
			}
			System.out.println("Case #"+(i+1)+": "+total);
		}
	}

}
