Sort positive and negative
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Sequence of integers is given. Sort the given sequence so that first the positive numbers are arranged in descending order, and then the negative numbers are arranged in ascending order. Zeroes should be placed at the end of the sequence.
Input
First line contains amount of numbers n (1 ≤ n ≤ 1000). Second line contains n integer, each no more than 2 * 10^9
by absolute value.
Output
Print in one line a sequence of numbers ordered according to the given condition.
Examples
Input #1
Answer #1
Submissions 324
Acceptance rate 66%