from decimal import Decimal, ROUND_HALF_UP T = int(input()) for t in range(T): D, A = map(int, input().split()) X = list(map(Decimal, input().split())) #print(D, A) #print(X) ans_list = [] for x in X: ans_list.append(int((x/A).quantize(Decimal('0'), ROUND_HALF_UP))) print(*ans_list)