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