import sys input = sys.stdin.readline def solve(): k,m,n = map(int,input().split()) y = [j for j in range(k)] c = [(y[i]+m-1)%k for i in range(k)] ans = 0 s = set() e = [] for i in range(k): now = i if now in s: continue temp = 1 x = [now] while now not in s: s.add(now) now = c[now] x.append(now) temp += 1 x.pop() e.append(x) ans += len(x)//2 if n <= ans: print('Yes') cnt = 0 for i in e: for j in range(len(i)): if j % 2 == 1: print(i[j]+1,end=' ') cnt += 1 if cnt == n: print() return else: print('No') return for i in range(int(input())): solve()