Problem 3075 · Medium

Maximize Happiness of Selected Children

Pick the happiest children first; each later pick has lost one point per earlier turn, so sort and subtract the turn index.

Open the interactive visualisation