Problem 2548 · Medium

Maximum Price to Fill a Bag

Fill a bag exactly with the most valuable mix: rank items by price per unit, then take fractions of the best ones first.

Open the interactive visualisation