
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define space " "
#define ll long long int
#define mod 1000000007
#define pi 3.1415926535897932384626433
#define inf 1000000000000000001;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y) 
#define mem(a,val) memset(a,val,sizeof(a))
#define pb push_back
#define f first
#define s second
#define fl(i,x,n)  for(ll i=x; i<n; i++)
#define fr(i,x,n)  for(ll i=n-1; i>=x; i--)
void solve()
{
	ll n,k; cin>>n>>k;
	ll d=n-k;
	std::vector<ll> v(k);
	fl(i,0,k) v[i]=i+1;
	ll p=k-1-d;
	reverse(v.begin()+p, v.end());
	fl(i,0,k) cout<<v[i]<<space;
	cout<<endl;
}

signed main()
{

fast;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

ll T=1;
cin>>T;
while(T--)
{
	solve();
}
return 0;
}
