#pragma GCC optimize("O3")
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <ctime>
#include <cstring>
#include <stack>
#include <ctime>
#include <iomanip>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

//#include <ext/pb_ds/assoc_container.hpp>

#define fi first
#define se second
#define th third

#define en "\n"
#define sqrt(n) sqrt((long double) n)
#define ALL(c) (c).begin() , (c).end()
#define MOD 998244353
#define MEM0(a) memset(a,0,sizeof(a))
#define FAST() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FILES(name) name!=""?freopen(name".in","r",stdin),freopen(name".out","w",stdout):0
#define elif else if
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define SZ(a) ((long long)((a).size()))
#define WHAT_IS(x) cerr << #x << " is " << x << en
#define TIMER (clock()*1.0/CLOCKS_PER_SEC)
#define int long long


using namespace std;

template<class A, class B, class C> struct triple { A first; B second; C third;
    bool operator<(const triple& t) const { if (first != t.first) return first < t.first; if (second != t.second) return second < t.second; return third < t.third; } };


typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> seti;
typedef long double ld;
typedef pair<ld, ld> pdd;
typedef triple<int, int, int> tiii;


const ld EPS=0.000000001;
const ld INFD32=1000000000;
const ll INF64=1000000000000000000;
const ll INF32=1000000001;
const ll one=1;

bool iss_ll(ll __1,ll __2){ return INF64/__1>=__2;}
bool equal(double _1,double _2){ return (abs(_1-_2)<EPS);}
bool iss_sqr(int &__1){ll __2=sqrt(__1); return __2*__2==__1;};
bool iss_prime(ll __1){for (int i=2; i*i<=__1; ++i) if (!(__1%i)) return 0; return 1;}
int gcd(int __1,int __2){ while (__1 && __2) if (__1>__2)  __1=__1%__2; else __2=__2%__1; return __1+__2;}
int lcm(int __1,int __2){ return __1*__2/(gcd(__1, __2));}
int sq_cube(ll x){if (x==0) return 1;int l=0,r=2e6;while (l+1<r){int m=(l+r)/2;if (m*m*m>x) r=m;else l=m;}return l;}
ll bp(ll a,ll b,ll md){ll res=1;while (b) {if (b&1) res*=a;a*=a;a%=md;res%=md;b>>=1;}return res;}
ll inv(ll x,ll md) {return bp(x, md - 2, md);}


void update_by_mod(int &x,int md){
    x%=md;
    if (x<0) x+=md;
}

void update_by_mod(int &x,int &y,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
}
void update_by_mod(int &x,int &y,int &z,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
}
void update_by_mod(int &x,int &y,int &z,int &a,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
    update_by_mod(a,md);
}

vector <int> z_function(string &s) {
    int n = SZ(s);
    vector<int> ans(n, 0);
    int l = 0, r = 0;
    for (int i = 1; i < n; ++i) {
        ans[i] = min(r - i + 1, ans[i - l]);
        while (ans[i] + i < n && s[ans[i]] == s[i + ans[i]]){
            ++ans[i];
        }
        if (i + ans[i] - 1 > r) {
            l = i, r = i + ans[i] - 1;
        }
        r = max(r, i);
    }
    return ans;
}

template <class T>
T sqr(T x){
    return x*x;
}

/*

#define maxN 500500

int fact[maxN],rfact[maxN];

void bld(int md) {
    fact[0] = 1;
    for (int i = 1; i < maxN; ++i) {
        fact[i] = fact[i - 1] * i % md;
    }
    rfact[maxN - 1] = bp(fact[maxN - 1], md - 2, md);
    for (int i = maxN - 2; i >= 0; --i) {
        rfact[i] = rfact[i + 1] * (i + 1) % md;
    }
}

int C(int n,int k,int md) {
    if (k > n) return 0;
    int res = fact[n];
    res *= rfact[k];
    res %= md;
    res *= rfact[n - k];
    res %= md;
    return res;
}

*/


#define maxN 500030

int md=1000000007;

int arr[maxN];

int cnt(vi v){
    int cnt=0;
    for (int i=0; i<v.size(); ++i){
        for (int j=i+1; j<v.size(); ++j)
            if (v[j]<v[i]) ++cnt;

    }
    return cnt;
}

void solve() {
    vi v;
    int n;
    cin>>n;
    int k;
    cin>>k;
    for (int i=1; i<=k; ++i) v.push_back(i);
    for (int i=k-1; i>=k-(n-k); --i){
        v.push_back(i);
    }
    int l=k-(n-k);
    vi ans;
    for (int i=1; i<l; ++i){
        ans.push_back(i);
    }
    for (int i=k; i>=l; --i){
        ans.push_back(i);
    }
    vi VEC;
    for (int i:v) VEC.push_back(ans[i-1]);
    //cout<<cnt(v)<<" "<<cnt(VEC)<<en;
    for (int i:ans) cout<<i<<" "; cout<<en;
}




signed main(void) {
    //look at the end
    srand(time(0));
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cerr<<TIMER<<en;
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; ++i) {
        //cout<<"Case #"<<i<<": ";
        solve();
    }
    cerr<<TIMER<<en;
    return 0;
}
//check special cases for example (n==1)
//check size  arrays