Problem 3462 · Medium

Maximum Sum With at Most K Elements

Each row allows a limited number of picks; keep the largest values per row, then the best k overall.

Open the interactive visualisation