#[allow(dead_code)] pub mod ut { pub type Result = std::result::Result>; pub mod input { use super::Result; use std::{error::Error, str::FromStr}; pub fn string() -> Result { let mut buf = String::new(); std::io::stdin() .read_line(&mut buf) .map_err(|e| e.into()) .map(|_| buf.trim().to_string()) } pub fn single() -> Result where ::Err: Error + 'static, { string().and_then(|x| x.parse::().map_err(|e| e.into())) } pub fn vector() -> Result> where ::Err: Error + 'static, { string()? .split_ascii_whitespace() .map(|x| x.parse::().map_err(|e| e.into())) .collect() } pub fn double() -> Result<(T, T)> where ::Err: Error + 'static, { let v = vector::()?; Ok((v[0], v[1])) } } } fn main() -> ut::Result { let t = ut::input::single::()?; for _ in 1..=t { let (a, b) = ut::input::double::()?; println!("{}", a * b + b); } Ok(()) }