from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN t = int(input()) for i in range(t): d, a = map(int, input().split()) x = list(map(int, input().split())) x = list( str(Decimal(str((x1 / a))).quantize(Decimal("0"), ROUND_HALF_UP)) for x1 in x ) print(" ".join(x)[0:])