Sum it up
Given a specified total and a list of integers, find all sums from the list that add up to the total. For example if the specified total is 4 and the list is 4 3 2 2 1 1, then we find
Sums of 4:43+12+22+1+1
Input
The input file may contain any positive number of lists. The data for each list will occupy two lines. The first of the two lines contains the specified total and the length of the list. The second line contains the list itself. All numbers will be separated by one or more blanks. The numbers in each list appear is decreasing order, but there may be repetitions. There will be at most 12 entries in each list, and each entry will be a positive integer less than 1000. The total will be a positive integer less than 1000.
Output
For each list in the input file, the output file will contain a line with "Sums of", the total, and a colon. Sums will be listed one to a line. If there are no such sums, the line "NONE" appears. The numbers in each sum should appear in decreasing order. A number may be repeated in the sum as many times as it was repeated in the original list. Each table of sums should be sorted so the first term of a sum that differs from the corresponding term of the next sum is larger than the term in that following sum. Each table of sums should have no duplicate lines. Each line should be terminated with a newline. The only blanks are single blanks before and after the word " of ".