import sys inf = float("inf") input = lambda: sys.stdin.readline().rstrip("\r\n") print = lambda *args, end="\n", sep=" ": sys.stdout.write( sep.join(map(str, args)) + end ) def II(): return int(input()) def MII(b=0): return map(lambda x: int(x) - b, input().split()) def LII(b=0): return list(MII(b)) def round(x, n): res = "{:.{}f}".format(x, n) if all(c not in res for c in "123456789"): res = res.strip("-") return res for _ in range(II()): d, a = MII() xs = LII() res = [] for x in xs: res.append(round(x / a, 0)) print(*res)