#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        int invers = k - (2*k - n);
        int tot = k + (n - k);

        vector<int>per;
        for(int i=1;i <=k - (invers + 1) ; i++){
            cout<<i<<" ";
            //per.push_back(i);
        }
        for(int i = k; i >= k - (invers + 1) + 1 ;i--){
            cout<<i<<" ";
            //per.push_back(i);
        }
        cout<<endl;

    }
}
