fn solve() -> usize { let mut abc = String::new(); std::io::stdin().read_line(&mut abc).ok(); let abc: Vec = abc.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let a = abc[0]; let b = abc[1]; let c = abc[2]; a.min(c) * 2 + b / 2 * 2 + (c - a.min(c)) / 2 + if a.min(c) < a && b % 2 == 1 { 1 } else { 0 } } fn main() { let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let t: usize = t.trim().parse().unwrap(); let mut result = Vec::with_capacity(t); for _ in 0..t { result.push(solve()); } for &v in result.iter() { println!("{}", v); } }