from decimal import * T=int(input()) for _ in range(T): D,A=list(map(int,input().split())) X=list(map(int,input().split())) ans=[] for x in X: d=Decimal(str(x/A)) d=d.quantize(Decimal("1"),rounding=ROUND_HALF_UP) ans.append(d) print(*ans)