@@ -0,0 +1,1128 @@
+//https://www.hackerrank.com/challenges/taum-and-bday%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        StringBuffer sb = new StringBuffer();%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        %0A        //For each test case%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A            %0A            //Get inputs%0A            String%5B%5D line = br.readLine().split(%22 %22);%0A            final int B = Integer.parseInt(line%5B0%5D);%0A            final int W = Integer.parseInt(line%5B1%5D);%0A            line = br.readLine().split(%22 %22);%0A            int X = Integer.parseInt(line%5B0%5D);%0A            int Y = Integer.parseInt(line%5B1%5D);%0A            final int Z = Integer.parseInt(line%5B2%5D);%0A            %0A            //Calculate minimum cost%0A            if(Y+Z %3C X)%7B%0A                X = Y+Z;%0A            %7D else if(X+Z %3C Y)%7B%0A                Y = X+Z;%0A            %7D%0A            long cost = (1L*B*X) + (1L*W*Y);%0A            %0A            //Print output%0A            sb.append(cost).append(%22%5Cn%22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A%7D%0A

Create taum-and-bday.java