AdvancedRating 1600
Combinations Adding to a Target
Print every way to choose numbers from the list (each position at most once) that add up to t. Print each combination in increasing order, list the combinations in alphabetical order, and never repeat one. Print NONE if there are none.
Input
n and t, then n positive integers.
Output
Lines.
Sample 1
Input
7 8 10 1 2 7 6 1 5
Output
1 1 6 1 2 5 1 7 2 6
Sample 2
Input
5 5 2 5 2 1 2
Output
1 2 2 5
Output appears here