Hide

Problem N
Bocchi's Rocks

Languages en ja sv

Bocchi has a collection of $N$ rocks of differnet weights. For each rock in her collection, Bocchi wants to know the amount of the other rocks that weigh less than the actual rock.

Input

First row consists of a single integer, $N$ $(1 \leqslant N \leqslant 2\cdot 10^5)$, amount of rocks that Bocchi has in her collection. The second row consists of $N$ integers, where the $i$th integer $w_i (1 \leqslant w_i \leqslant 10^9)$ is the weight of the $i$th rock, for all $1 \leqslant i \leqslant N$.

It is guaranteed that the weights of all rocks are different.

Output

Output $N$ integers on the same row, where the $i$th integer is the number of rocks that weigh less than the $i$th rock.

Points

Your solution will be tested on several test case groups. To get the points for a group, it must pass all the test cases in the group.

Group

Point value

Constraints

$1$

$10$

$N \leqslant 2$

$2$

$40$

$N \leqslant 1000$

$3$

$50$

No further constraints.

Sample Input 1 Sample Output 1
5
3 9 4 1 7
1 4 2 0 3
Sample Input 2 Sample Output 2
7
1 3 5 7 2 4 6
0 2 4 6 1 3 5