#include <iostream>
#include <vector>
#include <cmath>
#include "dbgHelper.h"
int main() {
    int t;
    std::cin >> t;
    std::vector<std::vector<int>> tests;
    for (int i = 0; i < t; i++) {
        int n, a, b;
        std::cin >> n >> a >> b;
        tests.push_back({n, a, b});
    }
    for (const auto& test : tests) {
        int n = test[0];
        int a = test[1];
        int b = test[2];
        if (a + b > n || std::abs(a - b) > n) {
            std::cout << "NO\n";
            continue;
        }
        if (a == 0 || a > n-1 || b == 0 || b > n-1)
        {
            std::cout << "NO\n";
            continue;
        }
        std::cout << "YES\n";
        for (int i = 1; i <= n; i++) {
            std::cout << i << " ";
        }
        std::cout << "\n";
        for (int i = n; i >= 1; i--) {
            std::cout << i << " ";
        }
        std::cout << "\n";
    }
    PAUSE;
    return 0;
}