#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int c, m, x;
    cin >> c >> m >> x;
    cout << min(c, min(m, ((c + m + x) / 3))) << endl;
  }
}
