#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
int n, a, b;
while (t--) {
cin >> n >> a >> b;
int wins = a + b;
int ties = n - wins;
if ((a + b > n) || (a == 0 && b != 0) || (b == 0 && a != 0)) {
cout << "NO\n";
return;
}
cout << "YES\n";
for (int i = b + 1; i <= wins; i++) {
cout << i << " ";
}
for (int i = 1; i <= b; i++) {
cout << i << " ";
}
for (int i = wins + 1; i <= n; i++) {
cout << i << " ";
}
cout << "\n";
for (int i = 1; i <= n; i++) {
cout << i << " ";
}
cout << "\n";
}
return 0;
}