@@ -0,0 +1,1541 @@
+import java.io.BufferedOutputStream;%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.io.PrintWriter;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Aclass COOLING %7B%0A%09private final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A%09private final PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out));%0A%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09new COOLING().run();%0A%09%7D%0A%0A%09private void run() throws IOException %7B%0A%09%09int T = Integer.parseInt(br.readLine());%0A%09%09while (T-- %3E 0) %7B%0A%09%09%09runTestCase();%0A%09%09%7D%0A%09%09pw.flush();%0A%09%7D%0A%0A%09private void runTestCase() throws IOException %7B%0A%09%09Integer pieCount = Integer.parseInt(br.readLine());%0A%09%09List%3CInteger%3E pieWeights = readArrayInLine(%22 %22);%0A%09%09List%3CInteger%3E towerLoads = readArrayInLine(%22 %22);%0A%09%09Collections.sort(pieWeights);%0A%09%09Collections.sort(towerLoads);%0A%09%09Integer loadablePies = 0;%0A%09%09Integer towerIndex = 0;%0A%09%09for (Integer pieWeight : pieWeights) %7B%0A%09%09%09while (towerIndex %3C pieCount) %7B%0A%09%09%09%09if (towerLoads.get(towerIndex++) %3E= pieWeight) %7B%0A%09%09%09%09%09loadablePies++;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09if (towerIndex %3E= pieCount) %7B%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09pw.println(loadablePies);%0A%09%7D%0A%0A%09private List%3CInteger%3E readArrayInLine(String seperator) throws IOException %7B%0A%09%09String%5B%5D inputArray = br.readLine().split(seperator);%0A%09%09List%3CInteger%3E resultArray = new ArrayList%3C%3E();%0A%09%09for (String input : inputArray) %7B%0A%09%09%09resultArray.add(Integer.parseInt(input));%0A%09%09%7D%0A%09%09return resultArray;%0A%09%7D%0A%7D%0A

Create COOLING.java