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