SP176 SUM1SEQ - Sum of one-sequence
Description
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} $ , ..., _a $ _{n} $_ \] is a one-sequence if
- for any _k_, such that 1
Input Format
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
Output Format
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.