logo AlgoBeat OnlineJudge
登录 注册

#217786. [JAG 2026 Summer Camp #1] Find Iotas

内存限制:2048 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are given a positive integer and a nonnegative integer .

Determine whether there exists a sequence of length satisfying all of the following conditions.

  • Each integer from to appears in exactly twice.
  • The sequence occurs exactly times as a subsequence of . In other words, there are exactly ways to choose indices such that ().

If such a sequence exists, output one. If multiple such sequences exist, output any one of them.

输入格式

The input consists of multiple test cases in the following format.

T
case_1
case_2
...
case_T

Each test case is given in the following format.

N X

The first line contains an integer (), the number of test cases.

For each test case, you are given a positive integer () and a nonnegative integer ().

The sum of over all test cases does not exceed .

输出格式

For each test case, if there is no sequence satisfying the conditions, print No on a single line.

Otherwise, print Yes on the first line, and print integers representing a sequence satisfying the conditions on the second line.

If there are multiple valid sequences, you may output any of them.

样例

样例输入 1

3
2 3
50 1000000000000000000
4 0

样例输出 1

Yes
1 2 1 2
No
Yes
4 4 3 3 2 2 1 1