|All-time Popular Problems|
|Construct Tree from Inorder & Preorder|
|Sum of two large numbers|
|Level order traversal in spiral form|
|Spirally traversing a matrix|
|Angle between hour and minute hand|
|Binary Tree to DLL|
|Smallest Positive missing number|
|Height of Binary Tree|
|Largest Number formed from an Array|
Given a set of integers, find distinct sum that can be generated from the subsets of the given sets and print them in an increasing order. It is given that sum of array elements is small.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer N denoting the size of array A.
The second line of each test case contains N space separated integers denoting elements of the array A[ ].
Print all the distinct sum that can be generated from the subsets in increasing order for each testcase in a new line.
1<= T <=100
1<= N <=100
1<= A[ ] <=100
2 3 4 5 6
0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20