@@ -0,0 +1,1677 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0A/**%0A*   Solution to https://www.hackerrank.com/challenges/taum-and-bday/%0A*/%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A%0A        long tests = read(in);%0A%0A        for (int i = 0; i %3C tests; i++) %7B%0A            long%5B%5D bw = readNumbers(in);%0A            long black = bw%5B0%5D;%0A            long white = bw%5B1%5D;%0A%0A            long%5B%5D xyz = readNumbers(in);%0A            long costBlack = xyz%5B0%5D;%0A            long costWhite = xyz%5B1%5D;%0A            long convertCost = xyz%5B2%5D;%0A%0A            System.out.println(solve(black, white, costBlack, costWhite, convertCost));%0A        %7D%0A    %7D%0A%0A    private static long solve(long b, long w, long costB, long costW, long convertCost) %7B%0A        if (costB %3E costW + convertCost) %7B%0A            //buy all whites%0A            return w * costW + b * (costW + convertCost);%0A        %7D%0A        else if (costW %3E costB + convertCost) %7B%0A            //buy all blacks%0A            return b * costB + w * (costB + convertCost);%0A        %7D%0A        else %7B%0A            //buy b + w without conversion%0A            return b * costB + w * costW;%0A        %7D%0A    %7D%0A%0A    private static long read(Scanner in) %7B%0A        return Long.parseLong(in.nextLine().trim());%0A    %7D%0A%0A    private static long%5B%5D readNumbers(Scanner in) %7B%0A        String next = in.nextLine().trim();%0A        String%5B%5D split = next.split(%22%5C%5Cs+%22);%0A%0A        long%5B%5D numbers = new long%5Bsplit.length%5D;%0A%0A        for (int i = 0; i %3C split.length; i++) %7B%0A            numbers%5Bi%5D = Integer.parseInt(split%5Bi%5D.trim());%0A        %7D%0A%0A        return numbers;%0A    %7D%0A%7D%0A

Create taum-and-bday.java