Problem: Puchi hates to carry luggage, but unfortunately he got a job to carry the luggage of his N friends in office. Each day,  one of his N friends, gives him the luggage of a particular weight to carry. You will be given the weight of luggage of each friend in the array Weight, where Weighti is the weight of luggage of i^th friend carried by Puchi on i^th day. It is given that all the luggages carried by Puchi are distinct in their weights. 
As Prateek assigned this job to Puchi, so for each day, he wants to know the number of days in future when Puchi will have to carry the luggage , having  weight less than the weight of luggage of current day.
Please help Prateek for the same.

Input:
The first line contains a single integer T, denoting the number of test cases. In each test case, the following input will be present: 
First line contains an integer N, where N represents the number of friends.
Next N line contains N integers, where i^th line contains i^th integer, which represents Weighti.   

Output:
Output exactly T lines. Each line contains N integer separated by a space, where i^th integer represents the number of luggage of future, which are less than the weight of luggage of the current day.

Constraints:

Subtask 1:
1 ≤ T ≤ 30
1 ≤ N ≤ 10^4
1 ≤ Weighti ≤ 10^6 
Subtask 2:
1 ≤ T ≤ 10
1 ≤ N ≤ 10^5
1 ≤ Weighti ≤ 10^6

SAMPLE INPUT
1
4
2
1
4
3

SAMPLE OUTPUT
1 0 1 0

Explanation

In sample input, given T =1 in first line and N = 4 in next line. In next 4 lines, Weighti i.e weight of luggage of each friend on i^th day is given.

For weight on first day i.e 2 ,future weights smaller than 2 are   {1} . Therefore output for this weight will be 1.
For weight on second day i.e 1, no future weights are smaller than 1. So output for this weight will be 0.
For weight on third day i.e 4, future weights smaller than  4 are {3}. So output for this weight will be 1.
For weight on fourth day i.e 3, no future weights are smaller than 3. So output for this weight will be 0.
So the final output is {1, 0, 1, 0}.

Solution (in PYTHON):

Solution:
# def mergearray(a,l1,b,l2):
# 	ptr1,ptr2=0,0
# 	c=[]
# 	while(ptr1<l1 and ptr2<l2):
# 		if a[ptr1]<b[ptr2]:
# 			c.append(a[ptr1])
# 			ptr1+=1
# 		elif a[ptr1]>b[ptr2]:
# 			# for j in xrange(ptr1,l1):
# 			# 	dic[a[j]]+=1
# 			acc=0
# 			temp=ptr2
# 			while(temp<l2 and b[temp]<a[ptr1]):
# 				acc+=1
# 				temp+=1
# 			c.extend(b[ptr2:temp])
# 			ptr2=temp
# 			for j in xrange(ptr1,l1):
# 				dic[a[j]]+=acc	
# 			# c.append(b[ptr2])
# 			# ptr2+=1
# 	if ptr1==l1:
# 		c.extend(b[ptr2:l2])
# 	elif ptr2==l2:
# 		c.extend(a[ptr1:l1])
# 	return c					

def mergearray(a,m,n):
	mid=(m+n)>>1
	p,q=m,mid+1
	c=[]
	while(p<=mid and q<=n):
		if a[p]>a[q]:
			c.append(a[q])
			q+=1
		elif a[p]<a[q]:
			dic[a[p]]+=q-mid-1
			c.append(a[p])
			p+=1
	while(p<=mid):
		dic[a[p]]+=q-mid-1
		c.append(a[p])
		p+=1
	while(q<=n):
		c.append(a[q])
		q+=1
	for i in xrange(n-m+1):
		a[m]=c[i]
		m+=1				
# def mergesort(a,m,n):
# 	mid=(m+n)/2
# 	if m==n:
# 		return [a[m]]
# 	if n==m+1:
# 		if a[n]<a[m]:
# 			dic[a[m]]+=1
# 			a[m],a[n]=a[n],a[m]
# 		return a[m:n+1]
# 	b=mergesort(a,m,mid)
# 	c=mergesort(a,mid+1,n)
# 	d=mergearray(b,mid-m+1,c,n-mid)
# 	return d
def mergesort(a,m,n):
	if(m<n):
		mid=(m+n)>>1
		mergesort(a,m,mid)
		mergesort(a,mid+1,n)
		mergearray(a,m,n)

t=input()
while(t>0):
	n=input()
	a,b=[],[]
	dic={}
	for i in xrange(n):
		temp=input()
		a.append(temp)
		b.append(temp)
		dic[a[i]]=0
	mergesort(a,0,n-1)
	for i in b:
		print dic[i],
	print	
	t-=1