import java.util.Scanner;
import java.io.*;
class dance
{
  public static void main (String[] args) throws IOException
  { 
    File    inputData = new File("B-small-attempt0.in");
	File 	outputData= new File("Boutput.txt");
    Scanner scan = new Scanner( inputData );
	PrintStream print= new PrintStream(outputData);
    
	int t;
	int n,s,p,pi;
	t= scan.nextInt();
	for(int i=1;i<=t;i++)
	{
	n=scan.nextInt();	s=scan.nextInt();	p=scan.nextInt();
	int supTrip=0, notsupTrip=0;
	
	for(int j=0;j<n;j++)
	{
		pi=scan.nextInt();
		if(pi>(3*p-3))
		notsupTrip++;
		else if((pi>=(3*p-4))&&(pi<=(3*p-3))&&(pi>p))
		supTrip++;
	}
	
	if(s<=supTrip)
	notsupTrip=notsupTrip+s;
	else if(s>supTrip)
	notsupTrip= notsupTrip+supTrip;
	print.println("Case #"+i+": "+notsupTrip);
	}
  }
}
package com.gcj.main;

import java.util.ArrayList;

import com.gcj.parser.Parser;
import com.gcj.parser.MaxPoints;

public class Main {


	public static void main(String[] args) {
		Parser parser = new Parser("resource/InputData.txt");
		ArrayList<Integer>[] datas = parser.toArray();
		int index = 1;

		for (ArrayList<Integer> dataRow : datas){
			
			int nbGooglers = dataRow.get(0).intValue();
			int nbSurprinsingResult = dataRow.get(1).intValue();
			int targetPoints = dataRow.get(2).intValue();
			
			int result = 0;
			
			for (int i = 0 ; i < nbGooglers ; i++) {
				if (MaxPoints.normal(dataRow.get(i+3)) >= targetPoints){
					result ++;
				}
				else {
					if (nbSurprinsingResult > 0){
						if (MaxPoints.surprising(dataRow.get(i+3)) >= targetPoints){
							result ++;
							nbSurprinsingResult --;
						}
					}
				}
			}
			
			StringBuffer stringBuf = new StringBuffer("Case #").append(index).append(": ").append(result);
			System.out.println(stringBuf.toString());
			index ++;
		}
	}
}