T=int(input()) for i in range(T): D,A=map(int, input().split(" ")) x=list(map(int,input().split(" "))) a=[] for j in range(D): X=x[j]//A if x[j]/A-X>=0.5: X+=1 a.append(X) print(*a)