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