AT_abc422_c [ABC422C] AtCoder AAC Contest
Description
Takahashi has some letters. Each letter he has is `A`, `B`, or `C`. Initially, he has $ n _ A $ letters `A`, $ n _ B $ letters `B`, and $ n _ C $ letters `C`.
He can hold one contest by using one letter `A`, one letter `C`, and additionally any one letter, for a total of three letters. Specifically, he can hold `AAC` by using two letters `A` and one letter `C`, `ABC` by using one letter each of `A`, `B`, and `C`, and `ACC` by using one letter `A` and two letters `C`.
He wants to hold as many contests as possible using the letters he currently has. Find the maximum number of contests he can hold.
$ T $ test cases are given, so report the answer for each of them.
Input Format
The input is given from Standard Input in the following format:
> $ T $ $ \mathrm{testcase} _ 1 $ $ \mathrm{testcase} _ 2 $ $ \vdots $ $ \mathrm{testcase} _ T $
$ \mathrm{testcase} _ i\ (1\le i\le T) $ represents the $ i $ -th test case and is given in the following format:
> $ n _ A $ $ n _ B $ $ n _ C $
Output Format
Output over $ T $ lines. On the $ i $ -th line $ (1\le i\le T) $ , output the answer to the $ i $ -th test case.
Explanation/Hint
### Sample Explanation 1
In the first test case, he can hold `AAC` once and `ABC` once, for a total of two contests. Therefore, output `2` on the first line.
### Constraints
- $ 1\le T\le2\times10 ^ 5 $
- For each test case,
- $ 0\le n _ A\le10 ^ 9 $
- $ 0\le n _ B\le10 ^ 9 $
- $ 0\le n _ C\le10 ^ 9 $
- All input values are integers.