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 PYTHON3):

Solution:
#!/usr/bin/env python
from __future__ import division, print_function
import math
import os
import sys
from sys import stdin,stdout
from io import BytesIO, IOBase
from collections import deque
#sys.setrecursionlimit(10**5)
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")
#-----------------------------------------------------------------
def binarySearchCount(arr, n, key):
    left = 0
    right = n - 1

    count = 0

    while (left <= right):
        mid = int((right + left) / 2)

        # Check if middle element is
        # less than or equal to key
        if (arr[mid] < key):
            count = mid + 1
            left = mid + 1

        # If key is smaller, ignore right half
        else:
            right = mid - 1
    return count
def regularbracket(t):
    p=0
    for i in t:
        if i=="(":
            p+=1
        else:
            p-=1
        if p<0:
            return False
    else:
        if p>0:
            return False
        else:
            return True
# endregion
"""
def samesign(a,b):
    if (a>0 and b>0) or (a<0 and b<0):
        return True
    return False
def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        arr = list(map(int,input().split()))
        sum1=0
        l=[arr[0]]
        for i in range(len(arr)-1):
            if samesign(arr[i+1],arr[i])==True:
                l.append(arr[i+1])
            else:
              #  print(l)
               # print(max(l))
                sum1+=max(l)
                l=[arr[i+1]]
        #print(sum1)
       # print(l)
        sum1+=max(l)
        print(sum1)
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        arr = list(map(int,input().split()))
        sum1 = sum(arr)
     #   max1 = max(arr)
        arr = sorted(arr)
        flag = True
        for i in range(1,n+1):
            if arr[i-1]>i:
                print("second")
                flag = False
                break
        if flag==True:
            diff = (n*(n+1))/2-sum1
            if diff%2==0:
                print("Second")
            else:
                print("First")
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        a = list(map(int,input().split()))
        seg = [0] * (n + 1)
        curr = 0
        cnt = 0
        for ai in a:
            if ai == curr:
                cnt += 1
            else:
                if cnt > 0:
                    seg[curr] += 1
                curr = ai
                cnt = 1
        if cnt > 0:
            seg[curr] += 1
        res = n
        for i in range(1, n + 1):
            if seg[i] == 0:
                continue
            op = seg[i] + 1
            if i == a[0]:
                op -= 1
            if i == a[-1]:
                op -= 1
            res = min(res, op)
        print((res))
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        a,b = map(int,input().split())
        if a==0 or b==0:
            print(0)
        elif a>=2*b or b>=2*a:
            print(min(a,b))
        else:
            print((a+b)//3)
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        n, m, x, y = map(int, input().split())
        ans = 0
        y = min(y, 2 * x)
        for i_ in range(n):
            s = input()
            i = 0
            while i < m:
                if s[i] == '*':
                    i += 1
                    continue
                j = i
                while j + 1 < m and s[j + 1] == '.':
                    j += 1
                l = j - i + 1
                ans += l % 2 * x + l // 2 * y
                i = j + 1
        print(ans)
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        n,x = map(int,input().split())
        arr = list(map(int,input().split()))
        p=0
        sum1 = sum(arr)
        arr = sorted(arr)
        if sum1//n>=x:
            print(n)
        else:
            for i in range(n-1):
                sum1-=arr[i]
                if sum1//(n-(i+1))>=x:
                    print(n-(i+1))
                    break
            else:
                print(0)
"""
def main():
    p = int(input())
    for _ in range(p):
        n,k = map(int,input().split())
        list1=[]
        if n==1 and k==1:
            print(0)
        else:
            for i in range(n,0,-1):
                if i+(i-1)<=k:
                    list1.append(i)
                    break
                else:
                    list1.append(i)
            list1.remove(k)
            print(len(list1))
            print(*list1)
if __name__ == '__main__':
    main()