|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||1024 MB||105||39||31||54.386%|
Usually, in programming contests the problem statement tells you what to do. We find that boring.
In this task we do the opposite. We will tell you something you must not do:
You must not sort the given sequence.
Given is a sequence S of distinct integers. Rearrange the sequence in any way. The only condition is that the resulting sequence must not be sorted – neither in ascending nor in descending order.
The first line of the input file contains an integer T specifying the number of test cases. Each test case is preceded by a blank line.
Each test case consists of two lines. The first line contains a number N (between 3 and 1000, inclusive) giving the length of the sequence. The second line contains N space separated numbers that form the sequence. No two of these N numbers are equal, and all of these numbers fit into a 32-bit signed integer variable.
The output format is the same as the input format, with one exception: The whitespaces may be arbitrary. Just make sure that every two tokens in the output are separated by at least one whitespace.
Each sequence in the output must contain the same numbers as the corresponding input sequence, and they must not be in sorted order.
2 5 1 2 3 4 5 8 3 1 4 47 5 9 2 6
2 5 5 1 4 3 2 8 3 1 4 47 5 9 2 6
In the first test case, First, make 3 grand mix pancakes. You are left with 9 bananas, 32 g of strawberry jam, 85 g of chocolate spread, and 10 walnuts. That is enough for another 9+1+3+1=14 easy pancakes. In the second test case, we only have enough flour for 30 pancakes.