#Lutece0700. Sasami's Power
Sasami's Power
Migrated from Lutece 700 Sasami's Power
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As we all know, Sasami is a professional Otaku. This month, the most famous animation shop ANIMATE hosts a new promotion activity, and she participates.
There's a sequence with numbers in ANIMATE's promotion activity board, which is numbered . Player should figure out another non-decreasing sequence in seconds, which has numbers and satisfies that for any (). Note that the sequence is not unique. In fact,one distinct sequence would get one special prize. Two sequences are different if they have different elements on the same index.(e.g. differs from ).
Sasami can use the power to get one answer immediately(if it exists), but how could a power-holder get only one imperfect prize? Therefore, she wonder show many different sequences totally that exist to get all the prizes.
Input
The first line of the input is (), the number of test cases.
Each test case starts with one integer (), which represents the length of sequence .
The following line contains integers, indicating the sequence .Each element of is less than .
Output
For each test case, you should output the answer in one line.
Samples
1
3
1 9 16
4
Note
All the valid non-decreasing sequences are as follows:
-2 3 6 10
0 1 8 8
-1 2 7 9
-3 4 5 11
Resources
The 7th BUPT Collegiate Programming Contest