{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tYou have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so the problem to solve is: you have a tape \u003ci\u003eN\u003c/i\u003e minutes long. How to choose tracks from CD to get most out of tape space and have as short unused space as possible.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tAssumptions:\u003c/p\u003e\r\n\u003cul\u003e\r\n\t\u003cli\u003e\r\n\t\tnumber of tracks on the CD. does not exceed 20\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\tno track is longer than \u003ci\u003eN\u003c/i\u003e minutes\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\ttracks do not repeat\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\tlength of each track is expressed as an integer number\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\t\u003ci\u003eN\u003c/i\u003e is also integer\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003e\r\n\tProgram should find the set of tracks which fills the tape best and print it in the same sequence as the tracks are stored on the CD\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tAny number of lines. Each one contains value\u0026nbsp;\u003ci\u003eN\u003c/i\u003e, (after space) number of tracks and durations of the tracks. For example from first line in sample data:\u0026nbsp;\u003ci\u003eN\u003c/i\u003e\u003d5, number of tracks\u003d3, first track lasts for 1 minute, second one 3 minutes, next one 4 minutes\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tSet of tracks (and durations) which are the correct solutions and string ``\u003ctt\u003esum:\u003c/tt\u003e\u0026quot; and sum of duration times.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n5 3 1 3 4\r\n10 4 9 8 4 2\r\n20 4 10 5 7 4\r\n90 8 10 23 1 2 3 4 5 7\r\n45 8 4 10 44 43 12 9 8 2\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\n1 4 sum:5\r\n8 2 sum:10\r\n10 5 4 sum:19\r\n10 23 1 2 3 4 5 7 sum:55\r\n4 10 12 9 8 2 sum:45\u003c/pre\u003e"}}]}