Problem: You are given two integers and . Find a sequence of non-negative integers of size at most such that the following conditions hold.
- There is no subsequence of with a sum of .
- For all where , there is a subsequence of with a sum of .
A sequence is a subsequence of if can be obtained from by the deletion of several (possibly, zero or all) elements, without changing the order of the remaining elements. For example, is a subsequence of .
It can be shown that under the given constraints, a solution always exists.
Input Format: The first line of the input contains a single integer () — the number of test cases. The description of the test cases follows.
Each test case consists of a single line containing two integers and (, ) — the parameters described above.
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: The first line of output for each test case should contain a single integer () — the size of your chosen sequence.
The second line of output for each test case should contain integers () — the elements of your chosen sequence.
If there are multiple solutions, print any.
Note: In the first example, we just need a subsequence that adds up to , but not one that adds up to . So the array suffices.
In the second example, all elements are greater than , so no subsequence adds up to . Every other integer between and is present in the array, so there is a subsequence of size adding up to each of those numbers.