The mayor of your city has decided to throw a party to gather the favour of his people in different regions of the city.
There are distinct regions in the city namely , , comprising of , and number of people respectively.
However, the mayor knows that people of the region are in conflict with people of regions and . So, there will be a conflict if people from region are present at the party along with people from region or .
The mayor wants to invite as many people as possible and also avoid any conflicts. Help him invite maximum number of people to the party.
Input Format
- The first line contains a single integer - the number of test cases. Then the test cases follow.
- The first line of each test case contains three integers , and - number of people living in regions , and respectively.
Output Format
For each test case, output the maximum number of people that can be invited to the party.
Constraints
Sample Input 1
3
2 3 4
1 5 2
8 8 8
Sample Output 1
6
5
16
Explanation
Test case-1: Mayor can invite all the people from region and . So the maximum number of people invited is .
Test case-2: Mayor can invite all the people from region . So the maximum number of people invited is .
No comments:
Post a Comment