#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<string>
#include<cstring>
#include<stack>
#include<queue>
#include<set>
#include<map>

using namespace std;
using ll = long long;
const ll n_ = 300300, inf = 1e18;

ll n, m, a, b, c, d, t, x, y, base = 1;
ll tree[n_ * 4][2], psum[n_], k;
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin >> t;
	while (t--) {
		cin >> n >> k;
		a = k;
		c = k;
		k = n - k;
		b = n- 2*k -1;
		for (int i = 0; i < b; i++) {
			cout << i + 1 << ' ';
		}
		for (int i = 0; i < c-b; i++) {
			cout << a-- << ' ';
		}
		cout << '\n';
	}

}