You went to market to buy fruits. You can buy one apple for one ruby, one diamond and one emerald. You can buy one banana for two rubies and two diamonds and you can buy one kiwi for two rubies and one diamond. You have a rubies, b diamonds and c emeralds. What are the maximum number of fruits that can be bought?
See sample case for better understanding
Input format:
First line contains one integer T, denoting the number of testcases.
Next T lines contains 3 integers a, b and c.
Output format:
For each testcase, print the maximum number of fruits that can be bought in a new line.
Constraints:
1 <= T <= 100000(1e5)
1 <= a, b, c <= 1000000000(1e9)
In first case, we have 3 rubies, 3 diamonds and 2 emeralds. Hence, we can buy one apple for 1 ruby, 1 diamond and 1 emerald. Then, we can buy one banana for 2 rubies and 2 diamonds. Hence, we can buy maximum 2 fruits.
In second case, we have 4 rubies, 2 diamonds and 2 emeralds. Hence, we can buy 2 kiwis for 4 rubies and 2 diamonds. Hence, we can buy maximum 2 fruits.