Money Sums
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You have coins with certain values. Your task is to find all money sums you can create using these coins.
Input
The first line has an integer : the number of coins.
The next line has integers : the values of the coins.
Output
In the first line print the number of distinct money sums.
In the second line print all possible sums in increasing order.
Examples
Input #1
Answer #1
Submissions 106
Acceptance rate 44%