from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN a=int(input()) d=[] e="" for i in range(a): b=list(map(int, input().split())) c=list(map(int, input().split())) for j in range(b[0]): d.append(int((Decimal(c[j])/Decimal(b[1])).quantize(Decimal('0'), ROUND_HALF_UP))) print(*d) d.clear()