6 人解决,10 人已尝试。
8 份提交通过,共有 26 份提交。
7.3 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
We say that a sequence of integers is a one-sequence if the difference between any two consecutive numbers in this sequence is $1$ or $-1$ and its first element is $0$. More precisely: $[a_1,a_2,\ldots,a_n]$ is a one-sequence if
Write a program that:
The number of test cases $t$ is in the first line of input, then $t$ test cases follow separated by an empty line.
In the first line of a test case there is a number $n$, such that $1 \le n \le 10~000$, which is the number of elements in the sequence. In the second line there is a number $S$, which is the sum of the elements of the sequence, such that $|S| \le 50~000~000$.
For each test case there should be written $n$ integers (each integer in a separate line) that are the elements of the sequence ($k$-th element in the $k$-th line) whose sum is $S$ or the word No
if such a sequence does not exist. If there is more than one solution your program should output any one.
Consequent test cases should by separated by an empty line.
1 8 4
0 1 2 1 0 -1 0 1
6 人解决,10 人已尝试。
8 份提交通过,共有 26 份提交。
7.3 EMB 奖励。