def round_int(x): return int(x * 2 + 1) // 2 t = int(input()) for i in range(t): d, a = map(int, input().split()) x = list(map(int, input().split())) x = list(str(round_int(x1 / a)) for x1 in x) print(" ".join(x)[0:])