#include<iostream>
#include<cstdio>
#include<cmath>
// Include headers as needed

using namespace std;

int main()
{
    // Write your code here
    int T,count,n,*a;
    // int imin;
    cin >> T;
    int value,hole;
    
    while(T--)
    {
        cin >> n;
        count=0;
        a=new int[n];
        //reading the input array
        for(int i=0;i<n;i++)
        {
            cin >> a[i];
        }
        
        // considering the 0th element to be already sorted and
        // remaining list unsorted
        // for(int i=1;i<n;i++)
        // {
        //     value=a[i];
        //     hole=i;
        //     // shifting 
        //     while(hole>0&&a[hole-1]>value)
        //     {
        //     	// 
        //         a[hole]=a[hole-1];
        //         hole=hole-1;
        //         count++;
        //     }
        //     a[hole]=value;
        // }
        // cout << count<<endl;
    }
    // Return 0 to indicate normal termination
    return 0;
}
