#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ ll A, B, C, ans = 0; cin >> A >> B >> C; auto f = [](ll &x, ll &y){ ll d = min(x, y); x -= d, y -= d; return d; }; ans += 2 * f(A, C); ans += 2 * (B / 2); B %= 2; ans += A / 2; cout << ans << '\n'; } }