Candies
Chef gave you an infinite number of candies to sell. There are $N$ customers, and the budget of the $i^{th}$ customer is $A_i$ rupees, where $1 \leq A_i \leq M$. You have to choose a price $P$, to sell the candies, where $1 \leq P \leq M$. The $i^{th}$ customer will buy **exactly** $\lfloor{\frac{A_i}{P}} \rfloor$ candies. Chef informed you that, for each candy you sell, he will reward you w
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