import sys input = sys.stdin.readline T=int(input()) for tests in range(T): K,M,N=map(int,input().split()) M-=1 if M==0: print("No") continue USE=[0]*K ANS=[] now=0 while True: if USE[now]==0 and USE[(now+M)%K]==0: ANS.append(now+1) USE[now]=1 USE[(now+M)%K]=1 now=now+2*M now%=K flag=0 else: pp=now while USE[now]==1 or USE[(now+M)%K]==1: #print(now,pp) now=now+M now%=K if pp==now: break #print(pp,now,"!") if pp==now: now=(now+1)%K if USE[now]==1 or USE[(now+M)%K]==1: break if len(ANS)>=N: print("Yes") print(*ANS[:N]) else: print("No")