You are given an array of positive integer numbers a1,a2...aN.
Count number of pairs (i,j) such that:
1≤ i ≤ N
1≤ j ≤ N
ai < aj
The first line contains 'T' denoting the number of test cases. Then follows description of testcases.Each case begins with a single positive integer N denoting the size of array.The second line contains N space separated positive integers denoting the elements of array.
For each test case, output a single line containing number of pairs for corresponding test case.
2 3 2
In the first test case, the only good pair is (2,1).
In the second test case, the two good pairs are (2,3) and (3,2).
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.