BIPCSMR16 - Team Building

no tags 

To make competitive programmers of BUBT, authority decide to take regular programming contest. To make this contest more competitive and fruitful there are some rules given to balance a team:

  1. Only 1st, 2nd and 3rd year students can participate.
  2. A team must have three members.
  3. All the members cannot be from the same year.

You need to find out the maximum number of teams can build up according to given rules.

Input

The first line of input contains an integer T (1 <= T <= 10000) the number of test cases. Next T line contains three positive integer X, Y and Z (1 <= X, Y, Z <= 2*10^9) separated by a space which denotes the number of participants from 1st, 2nd, and 3rd year student.

Output

You need to find out the maximum number of teams can build up according to given rules.

Example

Input:
2
1 2 3
1 12 3

Output:
2
4


Added by:Murad
Date:2016-09-02
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU
Resource:BUBT Intra University Programming Contest (Summer)-2016