for i in range(int(input())): a,b=map(int,input().split()) *c,=map(int,input().split()) print(*((2*i+b)//(2*b) for i in c))