for _ in range(int(input())): k, m, n = map(int, input().split()) m -= 1 used = [False] * k res = [] for i in range(k): if used[i]: continue last = -1 while not used[i]: used[i] = True if last == -1: last = i else: res.append(last) last = -1 i = (i + m) % k if len(res) < n: print('No') else: print('Yes') print(*(x + 1 for x in res[:n]))