#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    int c, m, x;
    cin >> c >> m >> x;
    int l = 0, r = (int)1e8;
    while (l < r) {
      auto mid = (l + r + 1) >> 1;
      int total = (c + m + x - mid - mid);
      if (total >= mid && c >= mid && m >= mid) {
        l = mid;
      } else {
        r = mid - 1;
      }
    }
    cout << l << '\n';
  }
  return 0;
}
