T = int(input()) for _ in range(T): D, A = map(int, input().split()) X = list(map(int, input().split())) P = [] for i in range(D): X[i] *= 10 X[i] //= A if X[i]%10 >= 5: X[i] += 10 P.append(X[i]//10) print(*P)