#include <iostream>
using namespace std;
int main() {
int t; cin >> t;
while(t--){
int n, k; cin >> n >> k;
int a[n];
for(int i=0; i<n; i++) a[i] = n-i;
/*for(int i=0; i<n-k-1; i++) cout << a[i] << " ";
for(int i=1; i<=k+1; i++) cout << k << " ";*/
for(int i=0; i<n; i++){
cout << a[i] << " ";
}
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgdDsgY2luID4+IHQ7Cgl3aGlsZSh0LS0pewoJCWludCBuLCBrOyBjaW4gPj4gbiA+PiBrOwoJCWludCBhW25dOwoJCWZvcihpbnQgaT0wOyBpPG47IGkrKykgYVtpXSA9IG4taTsKCQkvKmZvcihpbnQgaT0wOyBpPG4tay0xOyBpKyspIGNvdXQgPDwgYVtpXSA8PCAiICI7CgkJZm9yKGludCBpPTE7IGk8PWsrMTsgaSsrKSBjb3V0IDw8IGsgPDwgIiAiOyovCgkJZm9yKGludCBpPTA7IGk8bjsgaSsrKXsKCQkJY291dCA8PCBhW2ldIDw8ICIgIjsKCQl9CgkJY291dCA8PCBlbmRsOwoJfQoJcmV0dXJuIDA7Cn0=