#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, c, m, x;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &c, &m, &x);
    int mi = min(c, m);
    int ma = max(c, m);
    int sum = c + m + x;
    if (ma + x >= mi * 2)
      printf("%d\n", mi);
    else
      printf("%d\n", sum / 3);
  }
  return 0;
}
