#include <bits/stdc++.h>
using namespace std;
int del_x[4] = {-1, 1, 0, 0};
int del_y[4] = {0, 0, 1, -1};
int XX[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int YY[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int low = 0, high = 1e8;
  int ans;
  while (low <= high) {
    int x = a, y = b, z = c;
    int mid = low + (high - low) / 2;
    if (x + y >= 2 * mid && x >= mid && y >= mid &&
        (x + y + z - 2 * mid) >= mid) {
      low = mid + 1;
      ans = mid;
    } else {
      high = mid - 1;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
