const DIVISOR: u64 = 998_244_353; fn power(base: u64, p: u64) -> u64 { if p == 0 { return 1; } if p == 1 { return base; } let temp = power(base, p/2); temp * temp % DIVISOR * power(base, p%2) % DIVISOR } fn main() { let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let t: u8 = t.trim().parse().unwrap(); for _ in 0..t { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; println!("{}", n * (power(2, k) - 1) % DIVISOR * power(2, (n - 1) * k) % DIVISOR); } }