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