Souvik loves counting. He has a habit of generating any random logic and follow the same to start counting anything.
So one fine day he got an array of numbers. He, as usual could not resist the urge of counting and counted the number of elements of the array. But that was quite easy and Souvik didit quite easily. But he didn’t want the excitement to die down so easily. So he thought of a new logic.
He took the array and counted all the pair of integers such that i < j and A[i]>A[j], A being the array. As this is a tedious task, Souvik has turned to you to help him with the counting.
INPUT
First line of input will consist of a single integer T denoting number of test-cases. Each test-case will consist of two lines. First line will have a single integer N denoting number of integers in the array. Next line will contain N space separated integers denoting the contents of the array.
OUTPUT
For each test case, output a single integer denoting the total number of pairs satisfying the above condition.
CONSTRAINTS