{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAzzam is a well known thief who decided to rob a Jewelry Shop and fill his bag with a lot of jewels .\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003eAzzam has a bag with a capacity of $N$ and there is $m$ Jewels in the jewelry shop where the $i_t$$_h$ jewel takes capacity $m_i$ .\u003c/p\u003e\nWell, Azzam is too greedy and he wants to fill the bag with the highest possible capacity (make it as full as possible), this means that he wants to minimize the empty space in the bag.\n\n"}},{"title":"Assumptions","value":{"format":"HTML","content":"• Number of Jewels in the shop does not exceed 20.\n\u003cbr\u003e\n• No Jewel\u0027s capacity is more than $N$.\n\u003cbr\u003e\n• Jewels\u0027 capacity do not repeat (distinct).\n\u003cbr\u003e\n• Capacity of each Jewel is expressed as an integer number.\n\u003cbr\u003e\n"}},{"title":"Inputs","value":{"format":"HTML","content":" Any number of lines.\u003cbr\u003e Each one contains value $N$, followed by the number of Jewels and capacity of Jewels . \u003cbr\u003eFor example from first line in sample data: N \u003d 5, number of Jewels \u003d 3, first capcity \u003d 1, second one \u003d 3, next one \u003d 4.\n"}},{"title":"Outputs","value":{"format":"HTML","content":"Set of Jewels\u0027 capacity which are the correct solutions and string ‘sum:’ and sum of jewels\u0027 capacity.\n"}},{"title":"Sample Input","value":{"format":"HTML","content":"\n5 3 1 3 4\n\u003cbr\u003e\n10 4 9 8 4 2\n\u003cbr\u003e\n20 4 10 5 7 4\n\u003cbr\u003e\n90 8 10 23 1 2 3 4 5 7\n\u003cbr\u003e\n45 8 4 10 44 43 12 9 8 2\n"}},{"title":"Sample Output","value":{"format":"HTML","content":"1 4 sum:5\n\u003cbr\u003e\n8 2 sum:10\n\u003cbr\u003e\n10 5 4 sum:19\n\u003cbr\u003e\n10 23 1 2 3 4 5 7 sum:55\n\u003cbr\u003e\n4 10 12 9 8 2 sum:45\n "}}]}