use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let s: Vec<_> = s.trim().split('\n').skip(1).collect(); s.chunks(2).for_each(|s| { let a = s[0].split(' ').flat_map(str::parse).collect::>()[1]; let x: Vec = s[1].split(' ').flat_map(str::parse).collect(); println!( "{}", x.iter() .map(|&x| (x / a + (x % a >= (a + 1) / 2) as u64).to_string()) .collect::>() .join(" ") ); }); }