Problem: You are given two integers n and k. You are asked to choose maximum number of distinct integers from 1 to n so that there is no subset of chosen numbers with sum equal to k.

A subset of a set is a set that can be obtained from initial one by removing some (possibly all or none) elements of it.

Input

The first line contains the number of test cases T (1 ≤ T ≤ 100).

Each of the next T lines contains two integers n and k (1 ≤ k ≤ n ≤ 1000) — the description of test cases.

Output

For each test case output two lines. In the first line output a single integer m — the number of chosen integers.

In the second line output m distinct integers from 1 to n — the chosen numbers.

If there are multiple answers, print any. You can print the numbers in any order.

Example

Input


3
3 2
5 3
1 1


Output


2
3 1 
3
4 5 2 
0

Solution (in CPP):

Solution:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#include <boost/lexical_cast.hpp>
using namespace std;
  #define ll  long long
    #define rep(i,n) for(ll i=0;i<n;i++)
    #define pb push_back
    #define eb emplace_back
    #define in insert
    #define pll pair<ll,ll>
    #define mll map<ll,ll>
    #define si set<ll>
    #define sc set<char>
    #define msi multiset<ll>
    #define msc multiset<char>
    #define nokay cout<<(ok?"YES\n":"NO\n");

    
   // #define bs  binary_search
    #define rep1(x,n) for(ll x=n-1;x>=0;x--) 
    #define for1(i,a,n) for(ll i=a;i<n;i++)
    #define for2(i,a,n) for(ll i=n-1;i>=a;i--)
    #define F1 first
    #define S2 second
    #define vi vector<ll>
    #define vii vector<vector<ll>>
    #define vpi vector<pll>
    #define SORT(x) sort(x.begin(),x.end())
    #define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
    #define All(x) (x).begin(),(x).end()
    #define rAll(x) (x).rbegin(),(x).rend()
    #define db  double
    #define S size()
    #define EN end()
    #define BE begin()
    #define LEN length()
    #define itr(s) for(auto x:s)
    #define srt(x)  sort(x,x+n)
    #define inf LONG_LONG_MAX
    #define pq priority_queue<ll>

    
    const ll MAX=1e18+1;
    
    const double pi=3.1415926535897932384626433832;
    const ll M=1e9 +7;
    ll modpow(ll x,ll n,ll mod1){
    if(n==0)return 1%mod1;
    ll u=modpow(x,n/2,mod1);
    u=(u*u)%mod1;
    if(n%2==1)u=(u*x)%mod1;
    return u;

}
    ll POW(ll x,ll y){
        return modpow(x,y,inf);
    }
    ll MI(ll x,ll mod=M){
    return modpow(x,mod-2,mod);
}

    
    ll gcd(ll x,ll y){
        if(x==0)return y;
        else return gcd(y%x,x);
    }
    ll lcm(ll x,ll y){
        return (x*y)/gcd(x,y);
    }
   
bool isPrime(ll n) 
{  
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (ll i = 5; i * i <= n; i = i + 6){ 
        if (n % i == 0 || n % (i + 2) == 0){ 
            return false; 
        }
    }
    return true; 
} 

bool sumdigits(ll a ) {
    //ll a1=a;
    ll result = 0;
    while (a > 0) {
        
        result += a % 10;
        //cnt+=fac[a%10];
        a /= 10;
        //if(cnt>a1)return false;

    }
    //cnt=result;
    return result;
}

const ll Node=2e5 + 7;
vi adj[Node];
int vis[Node];
void addedge(ll u,ll v){
    adj[u-1].pb(v-1);
    adj[v-1].pb(u-1);
}
//set<ll>s[2];
//ll ok;
//ll c[Node];

void dfs(ll u){
    vis[u]=1;
    itr(adj[u]){
        if(!vis[x]){
            dfs(x);
        }
    }

}
ll modInverse(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
  
    if (m == 1) 
        return 0; 
  
    while (a > 1) { 
        // q is quotient 
        ll q = a / m; 
        ll t = m; 
  
        // m is remainder now, process same as 
        // Euclid's algo 
        m = a % m, a = t; 
        t = y; 
  
        // Update y and x 
        y = x - q * y; 
        x = t; 
    } 
  
    // Make x positive 
    if (x < 0) 
        x += m0; 
  
    return x; 
}
/*const ll  N=1e5 + 6;
ll prime[1000006],prime1[1000006];
vi v2;
void seive(ll N){
    ll cnt=0;
   // ll prime[n+1]={};
   // ll chk=2;
    for(ll i=2;i*i<=N;i++){
        if(prime[i]==0){
           // if(i>2){v2.pb((i*i - 1)/2 + 1);}
            //cnt++;
           // v.pb(i);
           if(i*i<=N){
            for(ll j=i*i;j<=N;j+=i)prime[j]=1;
        }
    }
}
/*for1(i,2,N+1){
    //if(i>2){if(!prime[i])v2.pb(i);}
    prime1[i]=prime1[i-1]+(!prime[i]?1:0);
}
}*/
   

/*const ll NC=100005,MOD=M;
ll inv[NC],fac_inv[NC],fac[NC];
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD; 
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
ll ncr1(ll n,ll r){
    ll cnt=1,j=1;
    for(ll i=n;i>=n-r+1;i--){
        cnt*=i;
        cnt/=(j);
        j++;
    }
    return cnt;
}*/

void solve()
{
    ll n,k;
    cin>>n>>k;
    map<ll,ll>mp;mp[k]=1;
    for1(i,1,n){
        for1(j,i+1,n+1){
            if(i+j==k){
                mp[i]=1;
                //mp[j]=1;
                //mp[k]=1;
               // break;
            }
        }
    } 
   
   if(mp.size()>1){
    cout<<n-mp.size()<<endl;
    for1(i,1,n+1){
        if(!mp[i])cout<<i<<" ";
    }
   }
   else{
    cout<<n-1<<endl;
    for1(i,1,n+1){
        if(!mp[i])cout<<i<<" ";
    }
   } 
   cout<<endl;
 
    
}

int main(){
        
       #ifndef ONLINE_JUDGE
               freopen("input.txt","r",stdin);
               freopen("output.txt","w",stdout);
               freopen("error.txt","w",stderr);
               #endif
               ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
      ll t=1;
    
  cin>>t;
     //initialize();
    //seive(N);

     
      while(t--){
         
           solve();
          // cout<<endl;
      } 
      
        return 0;
}