for _ in range(int(input())): D, A = map(int, input().split()) print(*[(i + A // 2) // A for i in list(map(int, input().split()))])