Codeforces Round 705 (Div. 2)
A
Anti-knapsack
Codeforces
800
原题
←B →
翻译中…

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 \le T \le 100$).

翻译中…

Each of the next $T$ lines contains two integers $n$ and $k$ ($1 \le k \le n \le 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.

翻译中…

样例

Input #1
3
3 2
5 3
1 1
Output #1
2
3 1
3
4 5 2
0
InputCopy OutputCopy
题目信息
题号
1493A
时间限制
1 s
内存限制
256 MB
标签
构造
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。