#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  a = ((a) < 0 ? -(a) : (a));
  b = ((b) < 0 ? -(b) : (b));
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
const long long inf = 2147383647;
const long long mod = 1000000007;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  int t;
  cin >> t;
  int x, y, z, a, b, c, ans;
  for (int kas = 1; kas <= t; kas++) {
    scanf("%d", &x);
    scanf("%d", &y);
    scanf("%d", &z);
    a = min(x, y);
    b = max(x, y);
    c = b - a;
    if (z <= a) {
      ans = (x + y + z) / 3;
      ans = min(ans, a);
    } else
      ans = a;
    printf("%d\n", ans);
  }
  return 0;
}
