#include <bits/stdc++.h>
using namespace std;
void solve() {
  int c, m, x;
  cin >> c >> m >> x;
  int left = 0, right = min(c, m), ans;
  while (left <= right) {
    int mid = left + (right - left) / 2;
    if (c + m + x - 2 * mid >= mid) {
      ans = mid;
      left = mid + 1;
    } else {
      right = mid - 1;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
