#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int cs = 1; cs <= t; cs++) {
    long long a, b, c, d, e, f, i, j, k, l;
    cin >> a >> b >> c;
    d = min(a, b);
    e = (a + b + c) / 3;
    cout << min(d, e) << endl;
  }
  return 0;
}
