#include using namespace std; using ll = long long; using P = pair; #define rep(i, a, b) for(ll i = a; i < b; ++i) #define rrep(i, a, b) for(ll i = a; i >= b; --i) constexpr ll inf = 4e18; struct SetupIO { SetupIO() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(30); } } setup_io; using dd = long double; using vl = vector; using vvl = vector; using vd = vector
; using vvd = vector; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a%b); } int main(void) { ll t;cin>>t; rep(i,0,t) { ll k,m,n;cin>>k>>m>>n; if (m == 1) { cout << "No" << endl; continue; } ll g = gcd(k, m-1); ll Loop_Size = k / g; ll Loop_Num = g; ll n_per_Loop = Loop_Size / 2; ll max_n = n_per_Loop * Loop_Num; if (max_n >= n) { cout << "Yes" << endl; ll cnt = 0; rep(i,1,g+1) { ll now = i; ll tmp = 0; while(true) { if (tmp % 2 == 0) { cnt += 1; if (cnt == n) { cout << now << endl; break; } else { cout << now << " "; } } now += (m-1); if (now > k) { now -= k; } tmp += 1; if (now == i) { break; } } if(cnt == n) { break; } } cout << endl; } else { cout << "No" << endl; } } return 0; }