DWITE Online Computer Programming Contest, December 2007, Problem 3
There's a library full of legally purchased music and a shiny new mp3 player that requires to be filled with the best possible playlist. Every song comes with a rating from
The input will contain five data sets. The first line will contain the space available in the player, a positive integer. The second line will specify the size of the music library,
The output will contain five lines, each containing an integer – a max sum of ratings that can fit on the player.
Sample Input
100
6
song_one 5 25
song_two 5 25
song_three 5 51
song_four 4 50
song_five 3 25
song_six 3 25
Sample Output
16
Problem Resource: DWITE
Comments
For those of you that are getting WA, you need to loop through and print everything 5 times as asked in the question. The Sample Output is only one example of an output.