Reselling Items
Chef is trying to buy some items from a store, and then resell them elsewhere to make a profit. For the $i$-th item, Chef knows that he can resell it for $A_i$ coins. The store has an ongoing offer. The first $K$ items that Chef buys will be offered at a discount of $5$ coins each, but the remaining items will all be offered at $10$ coins each. Chef can choose to buy any number of items, and in
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