题目描述
The mid-term exam has ended. Please help the teacher organize test papers according to their scores (in ascending or descending order), in order to calculate the ranking of students in the exam. Exams with the same score are counted as the same ranking.
输入格式
There are a total of three lines of input.
The first line is the amount of test papers(n).
The second line is sorting order, where 1 indicates ascending output and -1 indicates descending output.(seq)
The third row contains n non negative integers, which is the score of every paper, separated by ",".(xi)
输出格式
Output the results of the organized test paper, separated by spaces between scores.
提示/说明
1 ≤ n ≤ 1000
0 ≤ xi ≤ 100
seq = -1, 1