T = int(input()) for i in range(T): D, A = map(int, input().split(' ')) X = list(map(int, input().split(' '))) ans = [str(j//A + (1 if (j%A)*2 >= A else 0)) for j in X] print(' '.join(ans)) #print(' '.join([str(int(j/A+0.5)) for j in X]))