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
#include <bits/stdc++.h>

using namespace std;

const int CMod = 1000000007;
const long long CInf = 10000000000000001;
const double CDInf = 1000000000000000001;

bool isPalindrom(const string &S, int l, int r) {
    int n = S.length();
    for (int i = 0; i < l+r / 2; i++) {
        char a = S[i < l ? i : n-r + i-l];
        char b = S[i < r ? n-1 - i : l - (i - r) - 1];

        if (a != b) return false;
    }

    return true;
}

long long powInteger(long long base, int exp)
{
    long long res = 1;
    while (exp) {
        if (exp & 1) {
            res *= base;
            res %= CMod;
        }

        exp >>= 1;
        base *= base;
        base %= CMod;
    }

    return res;
}

long long gcd(long long a, long long b)
{
    if (a == 0) return b;
    if (b == 0) return a;
    if (a == b) return a;
    if (a > b) return gcd(a - b, b);

    return gcd(a, b - a);
}


void printNumber(deque <int> R)
{
    for (int i = 0; i < R.size(); i++) {
        cout << R[i];
    }
    cout << endl;
}

deque <int> subtract(deque <int> small, deque <int> big)
{
    for (int i = 1; i <= small.size(); i++) {
        big[big.size() - i] -= small[small.size() - i];

        int ind = big.size() - i;
        while (big[ind] < 0) {
            big[ind] += 10;
            ind--;
            big[ind]--;
        }
    }

    return big;
}

deque <int> addup(deque <int> a, deque <int> b)
{
    for (int i = 1; i <= a.size(); i++) {
        if ((int)b.size() >= i) {
            b[b.size() - i] += a[a.size() - i];
        } else {
            b.push_front(a[a.size() - i]);
        }


        int ind = b.size() - i;
        while (b[ind] >= 10) {
            int tmp = b[ind] / 10;
            b[ind] %= 10;
            ind--;

            if (ind < 0) {
                b.push_front(tmp);
            } else {
                b[ind] += tmp;
            }
        }
    }

    return b;
}

deque <int> multiply(deque <int> N1, deque <int> N2)
{
    deque <int> R;

    if (N1.size() == 1) {
        R.push_back(0);
        for (int i = 0; i < N1[0]; i++) {
            R = addup(N2, R);
        }

        return R;
    }

    if (N2.size() == 1) {
        R.push_back(0);
        for (int i = 0; i < N2[0]; i++) {
            R = addup(N1, R);
        }

        return R;
    }

    while ((int)N1.size() < (int)N2.size() || ((int)N1.size() % 2 > 0)) {
        N1.push_front(0);
    }

    while ((int)N2.size() < (int)N1.size() || ((int)N2.size() % 2 > 0)) {
        N2.push_front(0);
    }

    while ((int)N1.size() < (int)N2.size()) {
        N1.push_front(0);
    }

    deque <int> a, b, c, d;
    for (int i = 0; i < N1.size(); i++) {
        if (i < N1.size() / 2) a.push_back(N1[i]);
        else b.push_back(N1[i]);
    }

    for (int i = 0; i < N2.size(); i++) {
        if (i < N2.size() / 2) c.push_back(N2[i]);
        else d.push_back(N2[i]);
    }

    deque <int> ac = multiply(a, c);
    deque <int> bd = multiply(b, d);

    deque <int> ab = addup(a, b);
    deque <int> cd = addup(c, d);
    deque <int> adbc = multiply(ab, cd);

    adbc = subtract(bd, adbc);
    adbc = subtract(ac, adbc);

    for (int i = 0; i < N1.size(); i++) ac.push_back(0);
    for (int i = 0; i < N1.size() / 2; i++) adbc.push_back(0);

    R = addup(adbc, ac);
    R = addup(bd, R);

    return R;
}

vector <int> mergeSort(vector <int> &num, int l, int r, long long &counter)
{
    vector <int> A, B, C;

    if (l >= r) {
        C.push_back(num[l]);
        return C;
    }

    A = mergeSort(num, l, (l+r)/2, counter);
    B = mergeSort(num, (l+r)/2 + 1, r, counter);

    int ai = 0, bi = 0;

    for (int i = 0; i < r - l + 1; i++) {
        if (ai < (int)A.size() && (bi >= (int)B.size() || A[ai] <= B[bi])) {
            C.push_back(A[ai]);
            ai++;
        } else {
            C.push_back(B[bi]);
            bi++;
            counter += (long long)((int)A.size() - ai);
        }
    }

    return C;
}

void quickSort(vector <int> &V, int l, int r, long long &counter)
{
    if (l >= r) {
        return;
    }

    counter += (long long)(r - l);

    int low = l;

    int mid = (l + r)/2;

    int minP = min(V[l], min(V[r], V[mid]));
    int maxP = max(V[l], max(V[r], V[mid]));

    int pivot;

    if (V[l] != minP && V[l] != maxP) pivot = l;
    else if (V[r] != minP && V[r] != maxP) pivot = r;
    else pivot = mid;

    swap(V[l], V[pivot]);

    for (int i = l+1; i <= r; i++) {
        if (V[i] > V[l]) continue;
        swap(V[low + 1], V[i]);
        low++;
    }

    swap(V[l], V[low]);

    quickSort(V, l, low - 1, counter);
    quickSort(V, low + 1, r, counter);
}

int randomContract(set <int> &Vrt, multiset < pair <int, int> > &Edg)
{
    if (Vrt.size() <= 2) return (int)Edg.size();

    srand (time(NULL));
    int randEdg = rand() % Edg.size();

    set < pair <int, int> >::iterator it = Edg.begin();

    for (int i = 0; i < randEdg; i++) ++it;

    pair <int, int> tmp = *it;

    int u = tmp.first, v = tmp.second;

    for (it = Edg.begin(); it != Edg.end(); ) {
        tmp = *it;
        if (tmp.first == v || tmp.second == v) {
            Edg.erase(it++);
            if (tmp.first == v && tmp.second != u) {
                Edg.insert(make_pair(u, tmp.second));
            } else if (tmp.second == v && tmp.first != u) {
                Edg.insert(make_pair(tmp.first, u));
            }
        } else {
            it++;
        }
    }
    Vrt.erase(v);

    return randomContract(Vrt, Edg);
}

void DFS(map <int, vector <int> > &G, int v, vector <int> &M, vector <int> &L, int lead, int &t) {
    M[v] = 0;
    L[lead]++;

    for (int i = 0; i < G[v].size(); i++) {
        if (M[G[v][i]] == -1) {
            DFS(G, G[v][i], M, L, lead, t);
        }
    }

    t++;
    M[v] = t;
}

int findParent(vector <int> V, int u) {
    while (V[u] != u) {
        u = V[u];
    }

    return u;
}

double countDist(double ux, double uy, double vx, double vy) {
    return sqrt((ux - vx)*(ux - vx) + (uy - vy)*(uy - vy));
}

void traverse(vector < vector <int> > &G, vector < pair <int, int> > &A, int u, int v, int l) {
    A.push_back(make_pair(l, u));

    for (int i = 0; i < G[u].size(); i++) {
        if (G[u][i] == v) continue;
        traverse(G, A, G[u][i], u, l+1);
    }
}

void traverseCount(vector < vector <int> > &G, vector <int> &C, int u, int v, int d, long long &res) {
    if (C[u] > 0) {
        res += d;
    } else {
        d++;
    }

    for (int i = 0; i < G[u].size(); i++) {
        if (G[u][i] == v) continue;
        traverseCount(G, C, G[u][i], u, d, res);
    }
}

vector <long long> generatePrimes(long long n) {
    bool isPrime[n+1];
    memset(isPrime, true, sizeof(isPrime));
    vector <long long> P (n+1, 1);

    for (long long i = 2; i*i <= n; i++) {
        if (isPrime[i] == true) {
            for (long long j = i*i; j <= n; j += i) isPrime[j] = false;
        }
    }

    long long lastP = -1;
    for (long long i = n; i > 0; i--) {
        if (isPrime[i] == true) lastP = i;
        P[i] = lastP;
    }

    return P;
}

int main()
{
    int t;
    scanf("%d", &t);

    for (int ti = 0; ti < t; ti++) {
        int n, k;
        scanf("%d %d", &n, &k);

        vector <int> R;

        for (int i = k+1; i <= n; i++) {
            R.push_back(i);
        }

        int i = k-1, j = 1;
        while (j <= i) {
            R.push_back(i);
            i--; j++;
        }

        printf("%d\n", (int)R.size());
        for (int z = 0; z < (int)R.size(); z++) {
            printf("%d ", R[z]);
        }
        printf("\n");
    }

    return 0;
}
