#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#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<ll>;
using vvl = vector<vl>;
using vd = vector<dd>;
using vvd = vector<vd>;

ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a%b);
}

int main(void) {

    // rep(k,1,10) {
    //     rep(m,1,k+1) {
    //         rep(n,1,k+1){
    //             cout << k << " " << m << " " << n << endl;
    //         }
    //     }
    // }

    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;
            set<ll> st;
            rep(i,1,g+1) {
                ll now = i;
                ll tmp = 0;
                while(true) {
                    if (tmp % 2 == 0) {
                        st.insert(now);
                        st.insert((now + m - 2) % k + 1); 

                        cnt += 1;
                        if (cnt == n) {
                            cout << now << endl;
                            break;
                        } else {
                            cout << now << " ";
                        }
                    }
                    now += (m-1);
                    while (now > k) {
                        now -= k;
                    }
                    tmp += 1;
                    if (now == i) {
                        break;
                    }
                    if (tmp >= Loop_Size - 1) {
                        break;
                    }
                }
                if(cnt == n) {
                    break;
                }
            }
            // assert(cnt == n);

            // for (ll x : st) {
            //     cout << x << " ";
            // }
            // cout << endl;

            // if ((ll)st.size() != n * 2) {
            //     cout << "k = " << k << " m = " << m << " n = " << n << endl;
            //     return 0;
            // }
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}