#include <bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define time cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
typedef long long ll ;
typedef unsigned long long int ull;
ll MOD = 10000007 ;

void solve() {

  ll n, k ;
  cin >> n >> k  ;

  ll i ;

  vector<ll>arr(n + 1) ;

  for (i = 1 ; i <= k; i++) {
    arr[i] =  i  ;
  }

  ll t = k - 1 ;

  for (i = k + 1; i <= n; i++) {
    arr[i] = t ;
    t-- ;
  }
  // ll j ;

  // ll inv = 0    ;

  // for (i = 0 , j = 1; i < n - 1, j < n; i++, j++) {

  //   if (arr[i] > arr[j] ) {
  //     inv++ ;
  //   }
  // }

  // for (i = 1 ; i <= n; i++) {
  //   cout << arr[i] ;
  // }


  vector<ll>occ(n + 1)  ;
  vector<ll>ans;

  for (i = n; i >= 1; i--) {

    if (occ[arr[i]] == 1) {
      continue ;
    }
    else {

      ans.push_back(arr[i])  ;

      occ[arr[i]] = 1;
    }
  }

  reverse(ans.begin() , ans.end())   ;


  for (i = 0 ; i < ans.size()  ; i++) {
    cout << ans[i] << " " ;
  }

  //cout << inv << "\n" ;

  cout << endl ;



}
int main()
{

  fast ; time ;

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("error.txt", "w", stderr);
  freopen("output.txt", "w", stdout);
#endif

  ll t;
  cin >> t;

  while (t--) {
    solve()   ;
  }

  return 0  ;
}