Maximize Cost
CodeChefOpen on judge ↗
An online wholesale shop of metal rods follows a sale strategy such that the cost of a rod is inversely proportional to its length. That is, larger the rod length lesser the cost. The shop receives a rod of a certain length each day along with the cost of that length on that specific day, i.e. $Day$ $1:$ Length $L_1$ and cost of length $L_1$ is $C_1$, $Day$ $2:$ Length $L_2$ and cost of length $L_
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