for _ in range(int(input())): _, A = map(int, input().split()) ans = [(2 * x + A) // (2 * A) for x in map(int, input().split())] print(*ans, sep=' ')