import java.util.*;
import java.io.*;

public class DeceitfulWar {
    private final float[] naomi;
    private final float[] ken;
    private final int dim;
    private final int scoreOfDeceitfulWar;
    private final int scoreOfWar;
    public DeceitfulWar(float[] a, float[] b) {
        int i, j;
        dim = a.length;
        naomi = new float[dim];
        ken = new float[dim];
        for (i = 0; i < dim; i++) {
            naomi[i] = a[i];
            ken[i] = b[i];
        }
        Arrays.sort(naomi);
        Arrays.sort(ken);
        scoreOfDeceitfulWar = getScore(ken, naomi);
        scoreOfWar = dim - getScore(naomi, ken);
    }
    
    /**
     * Deceitful war is actually a mirror of war
     */
    private int getScore(float[] foe, float[] amigo) {
        int i = 0, j = 0, score = 0;
        while (i < dim && j < dim) {
            int id = getFirstElementLargerThanKey(foe[i], amigo, j, dim-1);
            if (id >= dim) break;
            j = id + 1;
            i++;
            score++;
        }
        return score;
    }
    
    /**
     * binary search to find the first larger element than the key
     * sorted array start index 'start'; end index 'end' (inclusive)
     * if key is larger than all elements in the array, return array size
     */
    private int getFirstElementLargerThanKey(float key, float[] array, int start, int end) {
        int n = array.length, mid = 0, lo = start, hi = end;
        while (lo <= hi) {
            mid = lo + (hi - lo)/2;
            if (key < array[mid]) hi = mid - 1;
            else {
                if (mid == n-1) return n;
                if (key < array[mid+1]) return mid + 1;
                lo = mid + 1;
            }
        }
        return mid;
    }
    
    public String toString() {
        return scoreOfDeceitfulWar + " " + scoreOfWar;
    }
    
    public static void main(String[] args) throws Exception {
        if (args.length != 2)
            throw new IllegalArgumentException("Require input and output filenames");
        Scanner sc = new Scanner(new FileReader(args[0]));
        PrintWriter pw = new PrintWriter(new FileWriter(args[1]));
        int caseCnt = sc.nextInt();
        for (int caseNum = 0; caseNum < caseCnt; caseNum++) {
            pw.print("Case #" + (caseNum + 1) + ": ");
            int num = sc.nextInt();
            float[] naomiBlocks = new float[num];
            float[] kenBlocks = new float[num];
            for (int i = 0; i < num; i++) {
                naomiBlocks[i] = sc.nextFloat();
            }
            for (int i = 0; i < num; i++) {
                kenBlocks[i] = sc.nextFloat();
            }
            DeceitfulWar dw = new DeceitfulWar(naomiBlocks, kenBlocks);
            pw.println(dw);
        }
        pw.flush();
        pw.close();
        sc.close();
    }
}
@@ -1937,12 +1937,12 @@
 gth 
-!= 2
+== 0
 )%0A  
@@ -2005,28 +2005,17 @@
 put 
-and output 
 file
+ 
 name
-s
 %22);%0A
@@ -2069,24 +2069,107 @@
 (args%5B0%5D));%0A
+        String outFilename = args%5B0%5D.replaceFirst(%22%5B.%5D%5B%5E.%5D+$%22, %22%22).concat(%22.out%22);%0A
         Prin
@@ -2216,15 +2216,19 @@
 ter(
-args%5B1%5D
+outFilename
 ));%0A

change static main