Coupons
CodeChefOpen on judge ↗
Today is independence day and Ankur is buying some items for the college cultural function.He is buying N items at the store, the regular price of the i-th item is pi. He has a discount coupon using which he can buy at most one item for half of the regular price. The price of remaining N−1 items are the same as regular prices which are given initially. What is the total $Minimum$ amount he will
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start