• + 0 comments
    public static long taumBday(int b, int w, int bc, int wc, int z) {
        // Write your code here
            long minmCost = 0;
            // long whiteBallCost = 0;
            // long blackBallCost = 0;
            
             long regularCost = (long)b * bc + (long)w * wc;
             
             long convertCostBlackToWhite = (long)b * Math.min(bc, wc + z) + (long)w * Math.min(wc, bc + z);
             
             minmCost = Math.min(regularCost, convertCostBlackToWhite);
            
            return minmCost;
        }