from decimal import Decimal, ROUND_HALF_UP T=int(input()) for i in range(T): D,A=map(int,input().split()) X=list(map(int,input().split())) ans = [] for j in range(D): a = X[j] / A aa = str(a) result = Decimal(aa).quantize(Decimal("0"), rounding=ROUND_HALF_UP) ans.append(result) print(*ans)