Problem Statement:
We want to decorate the corridor that leads to the ACM contest hall. We have only N Balloons. We want to maximize the number of balloons in the decoration, however, to make the corridor look good, both sides must be identical and in each side no two balloons with the same color should be adjacent.
Input Format:
T the number of test cases followed by T lines
Each line represent a test case
Each test case will have 4 numbers R G B Y
R is the number of red balloons
G is the number of green balloons
B is the number of blue balloons
Y is the number of yellow balloons
R, G, B and Y are integers between 0 and 1000 inclusive
Output Format:
For each case, print "Case q:" where q is the number of the test case (Zero Based Index)
For each test case print one single integer represent the maximum number of balloons that can be used to decorate both sides of the corridor
Sample Input:
2
1 1 1 1
0 1 2 3
Sample Output:
Case 0:
0
Case 1:
4
Added by:

gammal

Added at:

20150411 07:00:00 UTC

Time Limit:

1 second

Partial score:

No
