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

Solution:
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;

public class Equal {


    static class pair implements Comparable<pair> {
        int x;
        int y;

        public pair(int u, int  v) {
            this.x = u;
            this.y = v;
        }

        @Override
        public int compareTo(pair o) {
            return o.x-x;
        }
    }
    static int[][]mem=new int[1001][1001];
//    static int dp(int n,int k){
//        if(n>=mem.length)
//            return 0;
//        if(k<0||k>=mem.length)
//            return 0;
//        if(mem[n][k]!=-1)
//            return mem[n][k];
//    }
    static String timeInc(String time,int h,int m){
        String []s =time.split(":");
        int i=0;
        int hh=0;
        int mm=0;
        while (i<s[0].length()&&s[0].charAt(i)=='0'){
            i++;
        }
        if(i<s[0].length())
            hh=Integer.parseInt(s[0].substring(i));
        i=0;
        while (i<s[1].length()&&s[1].charAt(i)=='0'){
            i++;
        }
        if(i<s[1].length())
            mm=Integer.parseInt(s[1].substring(i));
        mm++;
        if(mm%m==0){
            mm=0;
            hh++;
            if(hh%h==0)
                hh=0;
        }
        String hs=""+hh;
        while(hs.length()<2)
            hs="0"+hs;
        String ms=""+mm;
        while (ms.length()<2)
            ms="0"+ms;
        return hs+":"+ms;

    }

    static boolean validMirror(String s,int h,int m){
        HashSet<Character>hs=new HashSet<>();
        hs.add('3');
        hs.add('4');
        hs.add('6');
        hs.add('7');
        hs.add('9');
        for (int i = 0; i <s.length() ; i++) {
            if(hs.contains(s.charAt(i))){
                return false;
            }
        }
        String mirrored="";
        for (int i = s.length()-1; i >=0 ; i--) {
            if(s.charAt(i)=='5'){
                mirrored+="2";
                continue;
            }
            if(s.charAt(i)=='2'){
                mirrored+="5";
                continue;
            }
            mirrored+=s.charAt(i);

        }
        int i=0;
        int hh=0;
        int mm=0;
        String []s2 =mirrored.split(":");
        while (i<s2[0].length()&&s2[0].charAt(i)=='0'){
            i++;
        }
        if(i<s2[0].length())
            hh=Integer.parseInt(s2[0].substring(i));
        i=0;
        while (i<s2[1].length()&&s2[1].charAt(i)=='0'){
            i++;
        }
        if(i<s2[1].length())
            mm=Integer.parseInt(s2[1].substring(i));
        if(hh>=h||mm>=m)
            return false;

        return true;
    }


    public static void main(String[] args) throws IOException {
        //BufferedReader br = new BufferedReader(new FileReader("name.in"));
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        PrintWriter out = new PrintWriter(System.out);
      int T=Integer.parseInt(br.readLine());
      while (T-->0){
         st=new StringTokenizer(br.readLine());
         int n=Integer.parseInt(st.nextToken());
         int k=Integer.parseInt(st.nextToken());
         int half=k/2;
         if(k%2==1)half++;
         ArrayList<Integer>a=new ArrayList<>();
          for (int i = n; i >=half ; i--) {
              if(i==k)
                  continue;
              a.add(i);
          }
          out.println(a.size());
          for (int i = 0; i <a.size() ; i++) {
              out.print(a.get(i));
              if(i<a.size()-1)
                  out.print(" ");
          }
          out.println();
      }


        out.flush();
        out.close();

    }

}