def solve(): D, A = map(int, input().split()) X = list(map(int, input().split())) def calc(x, A): return (2*x+A)//(2*A) return [calc(x, A) for x in X] #================================================== T = int(input()) for t in range(T): print(*solve())