I=input for _ in"_"*int(I()):A=int(I().split()[-1]);print(*[(2*int(x)+A)//(2*A)for x in I().split()])