#include <bits/stdc++.h> 
using namespace std;
using ll = long long;
 
int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int tc;
    cin >> tc;
    while(tc--){
    	int n, k;
    	cin >> n >> k;
    	for(int i = 1; i <= k; ++i) {
    		if(i == (2*k - n)) {
    			int x = k;
    			cout << x << " ";
    			++i; 
    			while(i <= k) {
    				cout << --x << " ";
    				++i;
    			}
    		}
    		else {
    			cout << i << " ";
    		}
    	}
    	cout << "\n";
    }
    return 0;
}