#include <bits/stdc++.h>
using namespace std;
const int MAX=1e9;
int main(){
  int t;
  cin>>t;
  while(t--){
    int n,k;
    cin>>n>>k;
    int dis=(n-k);
    int mi=k-dis;
    for(int i=1;i<mi;i++) cout<<i<<" ";
    for(int i=k;i>=mi;i--) cout<<i<<" ";
    cout<<endl;
  }
}
