t = int(input()) for _ in range(t): d, a = map(int, input().split()) p = list(map(int, input().split())) ans = [] for pi in p: ans.append((2*pi+a)//(2*a)) print(*ans)