#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T; cin >> T;
    while(T--){
        int K,M,N; cin >> K >> M >> N; M--;
        if(M == 0){cout << "No\n"; continue;}
        vector<vector<int>> Graph(K);
        for(int i=0; i<K; i++) Graph.at(i).push_back((i+M)%K);
        
        vector<bool> already(K);
        vector<int> answer;
        for(int i=0; i<K; i++){
            if(already.at(i)) continue;
            already.at(i) = true;
            queue<int> Q; Q.push(i);
            bool ok = true;
            while(Q.size()){
                int pos = Q.front(); Q.pop();
                if(ok) answer.push_back(pos),ok = false;
                else ok = true;
                for(auto to : Graph.at(pos)){
                    if(already.at(to)){
                        if(ok == false) answer.pop_back();
                        break;
                    }
                    Q.push(to); already.at(to) = true;
                }
            }
        }
        while(answer.size() > N) answer.pop_back();
        if(answer.size() < N) cout << "No\n";
        else{
            cout << "Yes\n";
            for(int i=0; i<N; i++) cout << answer.at(i)+1 << (i==N-1?"\n":" ");
        }
    }
}