#14. 輪符雨
輪符雨
Background
XCPC ONLINE is a next-generation VR virtual game. In this world, you will experience crafting iron, refining copper, molding silver, collecting gold, and might even become a legendary figure.
Today, you successfully logged into the XCPC NUAA server and received a starter pack.
Problem Statement
You have obtained a non-decreasing array of length (meaning that for all , ) and have been granted a magical ability:
- You can choose two integers and such that and perform the following operation: increase by and decrease by .
For example, if the array , and you choose and and use the magic, it becomes .
The use of magic is restricted. The XCPC system prefers non-decreasing arrays, so after each use of the magic, the array must remain non-decreasing.
Your task is to randomly apply this operation on valid pairs until it is no longer possible to use the magic. Finally, print the contents of the array after all operations have been completed.
Input Format
This problem contains multiple test cases.
- The first line contains an integer , the number of test cases.
For each test case:
- The first line contains an integer , representing the length of the array .
- The second line contains integers , representing the initial values of the array.
It is guaranteed that the total sum of over all test cases does not exceed .
Output Format
For each test case, output integers representing the contents of the array after it is no longer possible to apply the magic.
Example
Input
1
2
1 3
Output
2 2
相关
在下列比赛中: