Double Discount
Chef is craving a midnight snack, and so decided to order some food on the ChefEats app. There are $N$ food items available on the ChefEats app. The $i$-th item has a cost of $A_i$ rupees and a tastiness of $B_i$. It is guaranteed that each $A_i$ is an even integer. Chef wants to buy **exactly two** items of food from the app. ChefEats has a special offer ongoing: when you order two food it
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