from decimal import Decimal, ROUND_HALF_UP T = int(input()) for _ in range(T): D, A = map(int, input().split()) X = list(map(int, input().split())) ans = [None]*D for i in range(D): ans[i] = (Decimal(X[i])/Decimal(A)).quantize(Decimal('0'), rounding=ROUND_HALF_UP) print(*ans)