t = int(input()) for _ in range(t): k, m, n = map(int, input().split()) if k < n * 2 or m == 1: print("No") continue graph = [0 for _ in range(k + 1)] for a in range(1, k + 1): b = (a + m - 2) % k + 1 graph[a] = b ans = [] st = set() for start in range(1, k + 1): if start in st: continue now = start while (not now in st) and (not graph[now] in st): st.add(now) st.add(graph[now]) ans.append(now) now = graph[graph[now]] if len(ans) == n: break if len(ans) == n: break if len(ans) == n: print("Yes") print(*ans) else: print("No")