Problem D
Equal Sums (Easy)
I have a set of positive integers
Note: A subset is a set that contains only elements from
Input
The first line of the input gives the number of test cases,
Output
For each test case, first output one line containing
"Case #x:", where
-
If there are two different subsets of
that have the same sum, then output these subsets, one per line. Each line should contain the numbers in one subset, separated by spaces. -
If it is impossible, then you should output the string "Impossible" on a single line.
If there are multiple ways of choosing two subsets with the same sum, any choice is acceptable.
Limits
No two numbers in
Sample Input 1 | Sample Output 1 |
---|---|
2 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 120 266 858 1243 1657 1771 2328 2490 2665 2894 3117 4210 4454 4943 5690 6170 7048 7125 9512 9600 |
Case #1: 1 2 3 Case #2: 3117 4210 4943 2328 2894 7048 |