Write a program that, given an integer number and integer numbers , prints the subset (maybe with repeated numbers, but using every at most once) lexicographically largest among those whose sum is .
Input consists of an integer number , followed by a number , followed by .
Print, with the elements sorted non-increasingly, the subset that is
greatest in lexicographical order among those that can be made up with
and whose sum is
.
If there is none, print “no solution”.
Sort the given numbers.
Input
6 7 1 6 0 1 3 2 0
Output
{6,0,0}
Input
-5 3 6 -10 4
Output
no solution
Input
-5 9 3 1 -1 -1 0 -3 0 -2 2
Output
{2,0,0,-1,-1,-2,-3}
Input
-9 3 -5 6 -4
Output
{-4,-5}