- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of integers. Consider the sums of all subsets of the given array (including the empty subset with sum equal to zero).
Your task is to find the smallest subset sums.
Input
The first line has two integers and : the size of the array and the number of subset sums .
The next line has integers : the contents of the array.
Output
Print integers: the smallest subset sums in increasing order.
Constraints
Example
Input:
4 9 1 6 3 -3
Output:
-3 -2 0 0 1 1 3 3 4