Christmas Gift

1

1 votes
Easy
Problem

This Christmas , Santa Claus gave you three magical boxes with magical diamonds . you can full fill your any wish with these diamonds

you are given 3 boxes of diamonds each containing a,b,c number of diamonds you are given a chance to pick as much diamonds as possible there are rules that you have to follow .
   - you have to pick two diamonds at a time
   - both of the diamonds must be from two different boxes
   - you cant place a picked diamond back into any of the boxes

there are different ways to pick the diamonds your aim is to pick as many diamonds as possible

INPUT
first line of input contains a integer t number of test cases
each test case contains a single line of three integers a b and c

OUTPUT
for each test case output the maximum number of the diamonds possible

CONSTRAINTS
1<=t<=100
0<=a,b,c<=106

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

test case 1 : we can pick 2 from A and 2 from C . now we can pick 2 from B and 2 from C.

test case 2 : we can pick up 2 from B and 2 from C. now 1 will remain in C . so ans is 4.

Editor Image

?