#include "iostream"
using namespace std;

int Teamkeisan(int c, int a, int n) {
	int team = 0;
	for (; n > 0; n--) {
		if ((c > 0) && (a > 0)) {
			team++;
			c--;
			a--;
		}
	}
	for (; a > 0; a--) {
		if ((c > 1) && (a > 0)) {
			team++;
			c-=2;
		}
	}
	return team + c / 3;
}



int main()
{
	int Q = 0;
	int c[100], a[100], n[100];
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		cin >> c[i] >> a[i] >> n[i];
	}
	for (int i = 0; i < Q; i++) {
		cout << Teamkeisan(c[i], a[i], n[i]) << endl;
	}
	return 0;
}