#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1e9+7;
const int maxn = 2e6+5;
int main() {
	int T;
    scanf("%d",&T);
    while(T--) {
		int n,k;
		cin>>n>>k;
		int p = n-k+1;
		int cnt = 0;
		for(int i = 1;i <= k-p;i++) {
			cout<<i;
			if(++cnt==k) cout<<"\n";
			else cout<<" ";
		//	printf("%d%c",i,++cnt == k ?'\n' :' ');	
		}
		for(int i = k;i > k-p;--i) {
			cout<<i;
			if(++cnt==k) cout<<"\n";
			else cout<<" ";
		//	printf("%d%c",i,++cnt == k ?'\n' :' ');	
		}
    }
    return 0;
}


