ozs-paintings-16

Today Oz wants to make some money through his paintings. For painting, Oz has X white color pens, Y red color pens and Z green color pens. Their are 4 types of paintings he wants to make i.e. 
First kind of painting needs 3 white color pens.
Second kind of painting needs 3 red color  pens.
Third kind of painting needs 3 green color  pens.
Fourth kind of painting needs 1 white, 1 red and 1 green color pen.

Oz wants to earn more money so he wants to make maximum number of paintings. Help Oz to find the maximum number of paintings he can make.

Input :
The first line contains the number of test cases T. Each test case consists of 3 integers X, Y and Z — the number of white, red and green color pens.

Output :
For each test case print the maximum number of paintings Oz can make.

Constraint :
1 ≤ T ≤ 10
0 ≤ X, Y, Z ≤ 10^9

SAMPLE INPUT
1
4 4 4

SAMPLE OUTPUT
4

Explanation

Oz can make 1 first kind, 1 second kind, 1 third kind and 1 fourth kind painting

Source: hackerearth | Difficulty: EASY
Tags: Combinatorics

Mathematics

Ad-hoc


Solutions: