#include<bits/stdc++.h> #define LL long long #define STC static usingnamespace std; constint N = 1;
intmain() { int T, c, m, x; int l, r, mid, ans; scanf("%d", &T); while (T--) { scanf("%d%d%d", &c, &m, &x); l = ans = 0, r = min(c, m); while (l <= r) { mid = l + r >> 1; if ((c + m + x - mid) >= (mid << 1)) { ans = mid; l = mid + 1; } else r = mid - 1; } printf("%d\n", ans); } return0; }