1433  reverse order 1
Time Limit : 1 Second
Memory Limit : 128 MB
Submission: 691
Solved: 144
 Description
Here is a sequence a_{1..n}, which is a disordered sequence from 1 to N. If i < j and a_{i} > a_{j}, then <i, j> is called a pair of inversion. And b_{1..n1} is defined as follows, b_{k} is the number of the total inversion pairs in array a, when i<=k<j. Now the array b is required while the array a is known.
 Input
Several cases end with the end of the file;
And each of the cases includes two lines, a integer n(2<=n<=10^5)in the first line, and the second line followed with n integer, which is in the presentation of array a;
 Output
Output the answer of each case in a line, namely the array b, and a space is required between the adjacent integers.
 sample input

5 3 1 4 2 5
 sample output

2 1 2 0
 hint
 source