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
/*
 * @Author: your name
 * @Date: 2021-03-05 15:16:23
 * @LastEditTime: 2021-03-06 22:33:30
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \code_formal\cf\CF_700_3.cpp
 */
#include <iostream>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <map>
#include <vector>
#include <cstdio>
#define pr printf
#define sc scanf
#define sf(n) scanf("%d", &n)
#define sff(n1, n2) scanf("%d %d", &n1, &n2)
#define sfff(n1, n2, n3) scanf("%d %d %d", &n1, &n2, &n3)
#define sl(n) scanf("%lld", &n)
#define sll(n1, n2) scanf("%lld %lld", &n1, &n2)
#define slll(n1, n2, n3) scanf("%lld %lld %lld", &n1, &n2, &n3)
#define for0(i, n) for (i = 0; i < n; i++)
#define for1n(i, n) for (i = 1; i <= n; i++)
#define foran(i, a, n) for (i = a; i <= n; i++)
#define forna(i, a, n) for (i = n; i >= a; i--)
#define pb push_back
#define fi first
#define se second
#define mem(ara, n) memset(ara, n, sizeof(ara))
#define memb(ara) memset(ara, false, sizeof(ara))
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define sz(x) x.size()
const int N = 1e5 + 10;
const int mod = 998244353;
typedef long long int ll;
namespace fastIO
{
    inline void input(ll &res)
    {
        char c = getchar();
        res = 0;
        int f = 1;
        while (!isdigit(c))
        {
            f ^= c == '-';
            c = getchar();
        }
        while (isdigit(c))
        {
            res = (res << 3) + (res << 1) + (c ^ 48);
            c = getchar();
        }
        res = f ? res : -res;
    }
    inline ll qpow(ll a, ll b)
    {
        ll ans = 1, base = a;
        while (b)
        {
            if (b & 1)
                ans = (ans * base % mod + mod) % mod;
            base = (base * base % mod + mod) % mod;
            b >>= 1;
        }
        return ans;
    }
} // namespace fastIO
using namespace fastIO;

using namespace std;

int n, k;

int main()
{
    int _ = 1;
    sf(_);
    while (_--)
    {
        cin >> n >> k;

        int ans = n - k;
        int cnt = (k + 1) / 2, i, j;
        ans += k - cnt;
        cout << ans << endl;
        for (j = cnt; j <= k - 1; ++j)
            cout << j << " ";
        for (j = k + 1; j < n + 1; ++j)
            cout << j << " ";

        cout << endl;
    }

    return 0;
}
/*
3
7
1 4 2 2 2 2 2
2
2 3
5
1 1 1 1 1

4
3
0
*/