#K75252. Ranking Player Scores

    ID: 34378 Type: Default 1000ms 256MiB

Ranking Player Scores

Ranking Player Scores

In this problem, you are given the scores of N players. Your task is to determine the rank of each player based on their score. The ranking is performed in descending order, meaning that the highest score receives rank 1. If two or more players have the same score, they receive the same rank. The ranking formula can be represented in ( \LaTeX ) format as follows:

$$R(s) = 1 + \text{number of scores strictly greater than } s $$

Your program should read input from standard input (stdin) and output the result to standard output (stdout).

inputFormat

The input consists of two lines. The first line contains a single integer N (1 ( \leq ) N ( \leq ) 105), representing the number of players. The second line contains N space-separated integers, where each integer represents a player's score.

outputFormat

Output a single line containing N integers separated by a space. Each integer denotes the rank of the corresponding player's score in the input order.## sample

4
100 90 90 80
1 2 2 3

</p>