#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mp make_pair
#define pb push_back
#define fr(i,a,b) for(ll i=a;i<b;i++)
#define fr1(j,a,b) for(ll j=a;j<b;j++)
#define fr2(v,a,b) for(ll v = a -1;v>=0;v--)
void solve()
{ 
    ll n,k;
    cin>>n>>k;
    for(int i =1;i<=2*k-n-1;i++)
    cout<<i<<" ";
    for(int i = 1;i<=n-k;i++)
    cout<<k-i+1<<" ";
    cout<<2*k-n;
    
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    cin>>t;
    while(t--)
    {
        solve();
        cout<<endl;
    }
}