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:
///Fix the cause, not the symptom.

#include<bits/stdc++.h>
using namespace std;
#define ll           long long
#define ull          unsigned long long
#define db           double
#define sf           scanf
#define pf           printf
#define pb           push_back
#define pi           acos(-1)
#define MOD          1000000007
#define pii          pair<ll,ll>
#define time_save    ios_base::sync_with_stdio(false); cin.tie(NULL);

#define D(x)         cerr << __LINE__ << ": " << #x << " = " << (x) << '\n'
#define DD(x,y)      cerr << __LINE__ << ": " << #x << " = " << x << "   " << #y << " = " << y << '\n'
#define DDD(x,y,z)   cerr << __LINE__ << ": " << #x << " = " << x << "   " << #y << " = " << y << "   " << #z << " = " << z << '\n'
#define DBG          cerr << __LINE__ << ": Hi" << '\n'



/*----------------------Graph Moves----------------*/
//const ll dx[]={+1,-1,+0,+0};
//const ll dy[]={+0,+0,+1,-1};
//const ll dx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const ll dy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const ll dx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const ll dy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N  (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int main()
{
    //#ifndef ONLINE_JUDGE
    ///   freopen("in.txt","r",stdin);
    ///   freopen("out.txt","w",stdout);
    //#endif

    //time_save;

    ll t;
    cin>>t;
    while(t--){
        ll n,k,x;
        cin>>n>>k;
        ll b=(n-k);
        ll a=k/2;
        x=k+1;
        cout<<a+b<<endl;
        k--;
        for(ll i=1;i<=a;i++){
            cout<<k<<" ";
            k--;
        }
        for(ll i=1;i<=b;i++){
            cout<<x<<" ";
            x++;
        }
        cout<<endl;
    }
    return 0;
}