#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
const int N = 1e7;
void solve() {
  long long int a, b, c;
  cin >> a >> b >> c;
  cout << min(a, min(b, (a + b + c) / 3)) << '\n';
}
int main() {
  long long int q;
  cin >> q;
  while (q--) solve();
}
