------
## 最终结论
```python
q = int(input())
queries = [tuple(map(int, input().split())) for _ in range(q)]

results = []
for c, m, x in queries:
    max_teams = min(c, m, (c + m + x) // 3)
    results.append(max_teams)

for result in results:
    print(result)
```