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