#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define U 998244353
#define N 1000005
#define sz(c) (int)c.size()
#define fr first
#define ll long long 
#define ull uint64_t 
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi(i,a,n) for(int i=a ; i<n ; i++)
#define fd(i,n,a) for(int i=n-1 ; i>=a ; i--)
#define r0 return 0;
#define ln "\n"
#define INF (int)1e15
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);   

bool prime[100000005];
void seive()
{
    prime[0]=0;
    prime[1]=0;
    for(int i=2;i<100000005;i++){
        if(prime[i]==0){
            for(int j=i*i;j<100000005;j+=i)
                prime[j]=0;
        }
        else continue;
    }
    
}
//euler totient  
// void etf(){
// 	for(int i=0; i < 10000001; ++i)
// 		phi[i] = i;
// 	for(int i=2; i < 10000001; ++i){
// 		if(phi[i] == i ){
// 			for(int j=1; i*j < 10000001; ++j){
// 				phi[i*j] /= i;
// 				phi[i*j] *= (i-1);
// 			}
// 		}
// 	}
// }

int binexp(int a, int b, int m){
	int result = 1;
	while(b>0){
		if(b & 1){
			result = (result  * 1LL * a) % m;
		}
		a = (a * 1LL * a) % m;
		b >>= 1;
	}
	return result;
}

  
void solve(){
  
	ll n,k;cin>>n>>k;//a b
    vector<ll>v;
    fi(i,1,k+1) v.pb(i);
    ll x=n-k,j=k-1;
    x=k-1-x;
    while(x<j) {swap(v[x],v[j]);
        x++;
        j--;
    }
    fi(i,0,v.size()) cout<<v[i]<<" ";
        cout<<"\n";

}

int32_t main(){
 	fast
	int t;cin>>t;
 	//int t=1;
    while(t--) solve();
    
    int z=0;
    for(int p=1;p<=1000;p++)
    	z++;
	r0;
}