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.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;

/*
 * @author GOURAV KUMAR
 */
public class MyCpClass {

	// comment out to use Fast reader
//	static BufferedReader in;
//	static FastScanner scn;
//	static PrintWriter out;

	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) throws Exception {

		// comment out when using fast reader
//		PrintWriter out = new PrintWriter(System.out);
//		in = new BufferedReader(new InputStreamReader(System.in));
//		scn = new FastScanner(in);

//----------------------------------------Main Code Goes Here-------------------------------------------->>>
		int t = scn.nextInt();

		while (t-- > 0) {
			int n = scn.nextInt();
//			int[] arr = new int[n];
			int k = scn.nextInt();

			ArrayList<Integer> list = new ArrayList<Integer>();
			HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();

			for (int i = 1; i <= n; i++) {
				if (i != k) {
					map.put(i, 1);
				}
			}

			for (Integer val : map.keySet()) {
				int temp = k - val;
				if (map.containsKey(temp) && temp!=val) {
					map.put(temp, 0);
				}
				if (map.get(val) > 0) {
					list.add(val);
				}

			}
			System.out.println(list.size());
			for (int j = 0; j < list.size(); j++) {
				System.out.print(list.get(j) + " ");
			}
			System.out.println();

		}

//--------------------- comment out when using fast reader------------------------------------

//		int a = scn.nextInt();
//		long b = scn.nextLong();
//		double c = scn.nextDouble();
//		String d = scn.nextToken();
//		out.println(a);
//		out.println(b);
//		out.println(c);
//		out.println(d);
//		out.flush();
//---------------------------------------------------------------------------------------------		

//-----------------------------------Code Ends Here--------------------------------------------		
	}

//--------------------------------Some functions to use frequently-----------------------------

	public static void ArrayInput1D(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			arr[i] = scn.nextInt();
		}
	}

	public static void ArrayInput2D(int[][] arr) {
		for (int i = 0; i < arr.length; i++) {
			for (int j = 0; j < arr[0].length; j++) {
				arr[i][j] = scn.nextInt();
			}
		}
	}

	public static int max(int i, int j) {
		return i > j ? i : j;
	}

	public static int min(int i, int j) {
		return i < j ? i : j;
	}

	public static void swap(int[] arr, int i, int j) {
		int temp = arr[i];
		arr[i] = arr[j];
		arr[j] = temp;
	}

	public static HashMap<Integer, Integer> IntMap(int[] arr, HashMap<Integer, Integer> map) {

		for (int i = 0; i < arr.length; i++) {
			int temp = arr[i];
			if (map.containsKey(temp)) {
				map.put(temp, map.get(temp) + 1);
			} else {
				map.put(temp, 1);
			}
		}

		return map;
	}

	public static HashMap<Character, Integer> CharMap(String str, HashMap<Character, Integer> map) {

		for (int i = 0; i < str.length(); i++) {
			char temp = str.charAt(i);
			if (map.containsKey(temp)) {
				map.put(temp, map.get(temp) + 1);
			} else {
				map.put(temp, 1);
			}
		}

		return map;
	}

	public static long gcd(long a, long b) {
		if (a == 0)
			return b;

		return gcd(b % a, a);
	}

	static void sort(int a[]) {
		ArrayList<Integer> al = new ArrayList<>();
		for (int i : a)
			al.add(i);
		Collections.sort(al);
		for (int i = 0; i < a.length; ++i)
			a[i] = al.get(i);
	}

	class Pair {
		int x;
		int y;

		public Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}
	}

//---------------------------------Fast reader class-----------------------------------	
	static class FastScanner {
		BufferedReader in;
		StringTokenizer st;

		public FastScanner(BufferedReader in) {
			this.in = in;
		}

		public String nextToken() throws Exception {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(in.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws Exception {
			return Integer.parseInt(nextToken());
		}

		public long nextLong() throws Exception {
			return Long.parseLong(nextToken());
		}

		public double nextDouble() throws Exception {
			return Double.parseDouble(nextToken());
		}
	}
//---------------------------------------------------------------------------------------	
}