#include using namespace std; typedef long long ll; ll satisfaction(ll a, ll b, ll c){ ll ret; if(a>c) ret = 2*(c+b/2); else ret = 2*(a+b/2)+(c-a)/2; return ret; } int main() { int t;cin>>t; while(t--){ ll a,b,c;cin>>a>>b>>c; cout << satisfaction(a,b,c)<