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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class CodeForces extends Functions {
    static Scanner sc = new Scanner();
    public static void  solve() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        for(int i=1;i<=n;i++)set.add(i);
        boolean[] isVisited = new boolean[n+1];
        set.remove(k);
        isVisited[k] = true;
        for(int i=1;i<=n;i++){
            if(k-i>=0  && !isVisited[k-i] && k-i!=i){
                set.remove(k-i);
                isVisited[i] = true;
                if(k-i>=0)isVisited[k-1] = true;
            }

        }
        System.out.println(set.size());
        StringBuilder str = new StringBuilder();
        for(int ele : set)str.append(ele).append(" ");
        System.out.println(str);
    }

    public static void main(String[] args) {
        int testCase= sc.nextInt();
//        int testCase = 1;
        long start = System.currentTimeMillis();

        while (testCase-->0){

            solve();
        }
        long end = System.currentTimeMillis();
//        System.out.println("time took : "+(end-start));
    }

}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    public String next(){
        while (!st.hasMoreTokens())
            try {
                st = new StringTokenizer(br.readLine());
            }catch (IOException e){
                e.printStackTrace();
            }
        return st.nextToken();

    }
    public int nextInt(){return Integer.parseInt(next());}
    public long nextLong(){return Long.parseLong(next());}
    public double nextDouble(){return Double.parseDouble(next());}
    public int[] setIntegerArray(int n){
        int[] arr =new int[n];
        for(int i=0;i<n;i++)arr[i] = nextInt();
        return arr;
    }
    public long[] setLongArray(int n){
        long[] arr =new long[n];
        for(int i=0;i<n;i++)arr[i] = nextLong();
        return arr;
    }
    public int[][] set2DIntegerMatrix(int row,int col){
        int[][] arr = new int[row][col];
        for(int i=0;i<row;i++)
            for(int j= 0;j<col;j++)
                arr[i][j] = nextInt();
        return arr;
    }
}
class Functions {
    public static int mod = (int)1e9+7;
    public static void sort(int[] a){
        ArrayList<Integer> temp = new ArrayList<>();
        for (int j : a) temp.add(j);
        Collections.sort(temp);;
        for(int i=0;i<a.length;i++)a[i] = temp.get(i);
    }
    public static long factorial(int n){
        long fact = 1L;
        for(int i=2;i<=n;i++)fact=  (fact*i)%mod;
        return fact;
    }
    public static void sortRev(int[] a){
        sort(a);
        int left = 0;
        int right = a.length-1;
        while (left<right){
            int temp =a[left];
            a[left] = a[right];
            a[right] = temp;
            left++;
            right--;
        }
    }
    public static long isPrime(long n){
        for(long i=2;i*i<=n;i++)
            if(n%i==0)return i;
        return -1;
    }
}

