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