#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, a, b, c;
  cin >> T;
  while (T--) {
    scanf("%d%d%d", &a, &b, &c);
    int ans = min(a, b);
    ans = min(ans, (a + b + c) / 3);
    printf("%d\n", ans);
  }
  return 0;
}
