Company: paypal
Difficulty: medium
\n 2. Items Purchase \n \n \n A shop in HackerMall has n items where the price of the i th item is price[i]. A frequent customer has m discount coupons. If x discount coupons are used on the i th item, its price is reduced to the integer floor(price[i] / 2 x ), e.g. floor(3/2 1 ) = floor(1.5) = 1. \n \n Find the minimum amount needed to purchase all the items of the shop using at most m coupons. \n \n\n \n Function Description \n Complete the function findMinimumPrice in the editor below. \n findMinimumPrice has the following parameters: \n \n int price[n] : the original prices of the items \n int m : the number of discount coupons \n \n \n Returns \n \n int : the minimum amount of money needed to buy all n items \n \n \n\n \n Constraints \n \n 1 ≤ n ≤ 10 5 \n 1 ≤ price[i] ≤ 10 9 \n 0 ≤ m ≤ 10 9 \n \n \n\n \n Example \n Consider n = 2, price = [2, 4], m = 2. \n \n \n The optimum solution: \n \n Purchase item 1 for 2. \n Use 2 coupons on item 2, so the discounted price is 4/2 2 = 4/4 =