Professor Sofdor Ali is fascinated about twin towers. In this problem, you are working as his assistant, and you have to help him making a set of two large towers.
For this reason he gave you some rectangular bricks. You can pick some of the bricks and can put bricks on top of each other to build a tower. As the name says, you want to make two towers that have equal heights. And of course, there needs to be at least one brick for each of the towers.
For example, suppose there are three bricks of heights 3, 4 and 7. You can build two towers of height 7. One contains a single brick of height 7, and the other contains a brick of height 3 and a brick of height 4. If you are given bricks of heights 2, 2, 3 and 4 then you can make two towers with height 4 (just don't use brick with height 3).
Input
Input starts with an integer T (≤ 100), denoting the number of test cases.
Each case starts with an integer n (1 ≤ n ≤ 50), denoting the number of bricks. The next line contains n space separated integers, each containing the height of the brick hi (1 ≤ hi ≤ 500000). You can safely assume that the sum of heights of all bricks will not be greater than 500000.
Output
For each case, print the case number and the height of the tallest twin towers that can be built. If it's impossible to build the twin towers as stated, print impossible
.
Sample
Sample Input | Sample Output |
---|---|
4 3 3 4 7 3 10 9 2 2 21 21 9 15 15 14 24 14 3 20 23 15 | Case 1: 7 Case 2: impossible Case 3: 21 Case 4: 64 |