Description
Discretization, maps a finite number of individuals in an infinite space to a finite space, as a way to improve the spatio-temporal efficiency. Discretization means to reduce the data value accordingly without changing its relative size. (离散化,就是把无限空间中有限的个体映射到有限的空间中去,以此提高算法的时空效率。通俗的说,可以在不改变数据相对大小的条件下,对数据进行相应的缩小。)
Given a series $a$ of length $n$. Define the meaning of $\mathrm{rank}(i)$ : the number of distinct numbers in the series $a$ that are smaller than $a_i$ and plus one.
For $1 \leq i \leq n$, now find all $\mathrm{rank}(i)$.
Input format
There are multiple sets of test data within the single sample point of this question.
The first line of the input is an integer indicating the number of testing sets $T$. The information about each testing set is given next in turn:
The next line is an integer $n$, indicating the length of the array.
Then, the following line has $n$ integers for the array $a$ and the $i$th integer for $a_i$.
Output format
For each set of data, output a line of $n$ integers, separated by spaces, from $\mathrm{rank}(1)$ to $\mathrm{rank}(n)$.
Sample input
3 3 1 20 323410 5 1 600 200 200 700 4 -100 -200 -300 -300
Sample output
1 2 3 1 3 2 2 4 3 2 1 1
Constraints
For all test points, guarantee $1 \leq T \leq 5$, $1 \leq n \leq 10^3$, $-10^8 \leq a_i \leq 10^8$.