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())) P = [int(Decimal(x / A).quantize(Decimal('0'), rounding=ROUND_HALF_UP)) for x in X] print(*P)