using System; using System.Numerics; class Program { static void Main() { int T = int.Parse(Console.ReadLine()); while (T-- > 0) { var parts = Console.ReadLine().Split(); int D = int.Parse(parts[0]); BigInteger A = BigInteger.Parse(parts[1]); var xs = Console.ReadLine().Split(); var ans = new BigInteger[D]; BigInteger twoA = A * 2; for (int i = 0; i < D; i++) { BigInteger X = BigInteger.Parse(xs[i]); // 四捨五入: round(X / A) = floor((2X + A) / (2A)) ans[i] = (X * 2 + A) / twoA; } Console.WriteLine(string.Join(" ", ans)); } } }