#include <bits/stdc++.h>
using namespace std;
struct pt {
  long long x;
  long long y;
  char z;
};
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int n;
int main() {
  long long q, c, n, x;
  cin >> q;
  while (q--) {
    cin >> c >> n >> x;
    if (c <= n) {
      if ((n - c + x) >= c)
        cout << c << endl;
      else
        cout << (n + c + x) / 3 << endl;
    } else {
      if (n < c && (c - n + x) >= n)
        cout << n << endl;
      else
        cout << (n + c + x) / 3 << endl;
    }
  }
  return 0;
}
