• + 0 comments
    public static long taumBday(long noOfBlackGifts, long noOfWhiteGifts, long blackGiftPrice, long whiteGiftPrice, int conversionCost) {
        if(conversionCost < Math.abs(blackGiftPrice-whiteGiftPrice)) {
            if(blackGiftPrice < whiteGiftPrice) {
                whiteGiftPrice = blackGiftPrice + conversionCost;
            } else if(whiteGiftPrice < blackGiftPrice){
                blackGiftPrice = whiteGiftPrice + conversionCost;
            }
        }
        return (noOfBlackGifts * blackGiftPrice) + (noOfWhiteGifts * whiteGiftPrice);
    }