#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N 200010

inline int read(){
	int Num=0,F=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')F=-1;ch=getchar();}
	while(isdigit(ch)){Num=(Num<<3)+(Num<<1)+(ch^48);ch=getchar();}
	return Num*F;
}

int main(){
	int T=read(),n,k;
	while(T--){
		n=read(),k=read();
		for(int i=1;i<2*k-n;++i) printf("%d ",i);
		for(int i=n-k;i>=0;--i) printf("%d ",i+2*k-n);
		printf("\n");
	}
	return 0;
}