#include using namespace std; //#include //using namespace atcoder; //typedef modint998244353 mint; typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) void solve(){ int k,m,n; cin >> k >> m >> n; vector seen(k); vector> ans; auto a = [&](int i){ return (i+m-1) % k; }; rep(i,0,n){ if(seen[i])continue; int x = i; while(true){ if (seen[x]) break; if (!seen[a(x)] && x != a(x)){ ans.push_back(pair(x,a(x))); seen[x] = 1; seen[a(x)] = 1; x = a(a(x)); }else{ seen[x] = 1; x = a(x); } } } if ((int)ans.size() >= n){ cout << "Yes\n"; rep(i,0,n){ cout << ans[i].first+1 << ' '; } cout << '\n'; }else{ cout << "No\n"; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--) solve(); }