#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, a, b, c, x, y;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    x = min(a, b);
    if (x <= c + a - x + b - x)
      cout << x << endl;
    else {
      y = ceil((x - c - abs(a - b)) / (3 + 0.0));
      cout << x - y << endl;
    }
  }
  return 0;
}
