# https://www.hackerrank.com/challenges/absolute-permutation?h_r=next-challenge&h_v=zen
def switch(data, i, j):
    data[i], data[j] = data[j], data[i]

t = int(input().strip())
for a0 in range(t):
    n,k = input().strip().split(' ')
    n,k = [int(n),int(k)]
    if k == 0:
        print(' '.join([str(x) for x in range(1, n+1)]))
    elif n % (k*2) == 0:#k is a factor of n
        #Divide into sets as long as 2K
        output = list(range(1, n+1))
        for i in range(int(n/(2*k))):
            #for each block
            for j in range(k):
                switch(output, i*2*k+j, i*2*k+j+k)
        print(' '.join(str(x) for x in output))
    else:
        print(-1)
