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