// In The Name Of God

/*  ki oomade?!  */
#include <bits/stdc++.h>

typedef long long ll;
#define pb push_back
#define S second
#define F first

using namespace std;
const int N = 1e6 + 10;
const ll inf = 1e18;

ll q, n, a[N], ans;
string s, t;
int main()
{
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	
  cin >> q;
  while(q --){
    ll k;
    cin >> n >> k;
    vector <ll> v;
    ll l = 1, r = k - 1;
    while(v.size() < k){
      if(v.size() == k - (n - k) - 1) v.pb(k);
      else if(v.size() < k - (n - k) - 1) v.pb(l), l ++;
      else if(v.size() >= k - (n - k)) v.pb(r), r --;
    }
    for(auto x : v) cout << x << ' ';
      cout << endl;
  }	
}
/*
 _____       ____                  _       _ _     _          ____           
|_   _|_ _  / ___| _ __   ___  ___(_) __ _| (_)___| |_ ___   |  _ \ __ _ ___ 
  | |/ _` | \___ \| '_ \ / _ \/ __| |/ _` | | / __| __/ _ \  | |_) / _` / __|
  | | (_| |  ___) | |_) |  __/ (__| | (_| | | \__ \ || (_) | |  __/ (_| \__ \
  |_|\__,_| |____/| .__/ \___|\___|_|\__,_|_|_|___/\__\___/  |_|   \__,_|___/
                  |_|                                                        
 _   _             _                          _                              
| \ | | __ _  __ _(_)_ __ __ _ _ __ ___      / \   _ __ ___   ___  _ __ ___  
|  \| |/ _` |/ _` | | '__/ _` | '_ ` _ \    / _ \ | '__/ _ \ / _ \| '_ ` _ \ 
| |\  | (_| | (_| | | | | (_| | | | | | |  / ___ \| | | (_) | (_) | | | | | |
|_| \_|\__,_|\__, |_|_|  \__,_|_| |_| |_| /_/   \_\_|  \___/ \___/|_| |_| |_|
             |___/                                                           
 _   _                _       _       _                     
| \ | | ___ _ __ ___ (_) __ _(_) __ _(_)_ __ __ _ _ __ ___  
|  \| |/ _ \ '_ ` _ \| |/ _` | |/ _` | | '__/ _` | '_ ` _ \ 
| |\  |  __/ | | | | | | (_| | | (_| | | | | (_| | | | | | |
|_| \_|\___|_| |_| |_|_|\__, |_|\__, |_|_|  \__,_|_| |_| |_|
                        |___/   |___/ 
           																	*/