1671 统计问题3


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

继续来统计 = =

给定一个非负数列 {An} ,对于每一个数Ai问有多少个 Aj 满足 j < i ,且 Aj <= Ai 。 1<=n<=100000,0<=Ai<2^31。

Input

有多组测试数据,处理到文件结束。每组数据有两行,第一行两个整数 n ,第二行 n 个非负整数,表示数列 {An} 。

Output

对于每组数据,输出一行,n个数,每两个数之间空一格。

Sample

Input

5
1 4 7 4 8
5
1 4 8 7 7

Output

0 1 2 2 4
0 1 2 2 3

Hint

输入输出用scanf printf。


Source: guoduanac


Comments

There are no comments at the moment.