#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, x, sum = 0, ans;
    cin >> n >> m >> x;
    sum = n + m + x;
    ans = min(n, m);
    sum = sum / 3;
    ans = min(sum, ans);
    cout << ans << "\n";
  }
}
