The mailroom stocks up to ten di erent types of stamps, and only ten stamps will fit on any given parcel.
Your program would read in a list of stamp values stocked by the mailroom (all separated by single spaces) followed by a sequence of amounts to convert (one amount per line). If it is impossible to reach the given amount exactly, you are to exceed the amount by as little as possible. If there are many sets of stamps that cover the amount for the same cost, you should pick the set with the least number of stamps. Output should consist of the given stamp values on a single line followed by a blank line, then, for each amount given, the amount that needs to be covered on a single line, followed by the stamps needed for the coverage on the next line, followed by a blank line. (So the last line of stamp values in the output is followed by one blank line.) As usual, all numbers are separated by single spaces. If no solution exists, print
NO SOLUTION EXISTSThe input file ends with an end-of-file. See next page for a sample input and output.
2 7 14 17 22 63 98 72 86 143 5
STAMP VALUES 2 7 14 17 22 63 98 AMOUNT 72 STAMPS USED 63 7 2 AMOUNT 86 STAMPS USED 63 14 7 2 AMOUNT 143 STAMPS USED 63 63 17 AMOUNT 5 STAMPS USED 2 2 2