Problem 2819 · Medium

Minimum Relative Loss After Buying Chocolates

Each chocolate scores Bob’s share minus Alice’s share at the budget k; sort the scores and keep the m smallest.

Open the interactive visualisation