#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long mod = 1e9 + 9;
const int inf = 0x3f3f3f3f;
long long co[maxn];
string str;
long long n, m, k, t, need, ans = 0;
bool vis[maxn];
vector<int> ff[maxn];
int cnt[105][105];
int xx[] = {1, 1, 2, 2, -1, -1, -2, -2};
int yy[] = {2, -2, 1, -1, 2, -2, 1, -1};
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    if ((n + m + k) / 3 > min(n, m))
      cout << min(n, m) << endl;
    else
      cout << (n + m + k) / 3 << endl;
  }
}
