#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ int k, m, n; cin >> k >> m >> n; m--; if(2 * n > k){ cout << "No\n"; continue; } if(m == 0){ cout << "No\n"; continue; } vector ans; vector used(k); int p = 0, cnt = 0; int th = 10 * k; while(true){ while(used[p] || used[(p + m) % k]){ p++; cnt++; if(p == k) p = 0; if(cnt >= th) break; } if(cnt >= th) break; used[p] = used[(p + m) % k] = true; ans.emplace_back(p + 1); p = (p + m - 1 + k) % k; } if(ans.size() < n){ cout << "No\n"; continue; } cout << "Yes\n"; for(int i = 0; i < n; i++){ cout << ans[i] << (i + 1 == n ? '\n' : ' '); } } }