Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If you take a number, you might as well take them all. Keep track of what the value is of the subset of the input with maximum M when you either take or don't take M.