T = int(input()) for _ in range(T): D, A = map(int, input().split()) X = list(map(int, input().split())) Y = [(2*x+A)//(2*A) for x in X] print(*Y)