#include<iostream>
using namespace std;
#include<bits/stdc++.h>
#define ll long long
#define forn(i,n) for(ll i=0;i<n;i++)

ll minimum(ll x,ll y){
return min(x,y);
}
ll maximum(ll x,ll y){
return max(x,y);
}

// BIT
/*
vector<vector<ll> > bit(3e5);
ll lowbit(ll x){
return x&-x;}

void add(ll i,ll x,ll n){

for(;i<=n;i+=lowbit(i))bit[i].push_back(x);

}
ll query(ll i,ll x){

    ll ans=0;
    for(;i;i-=lowbit(i)){
        ll pos = lower_bound(bit[i].begin(),bit[i].end(),x) - bit[i].begin();
        ans += bit[i].size()-pos;
    }
    return ans;
}

*/


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll MAX=	9223372036854775807;
     ll test;
    cin>>test;
    ll mod = 998244353;
    //test = 1;


    while(test--)
        {
            ll n;
            cin>>n;
            vector<ll> a(n);
            forn(i,n)
            cin>>a[i];

            ll cnt=0;
            while(true){

                bool con=false;
                forn(i,a.size()-1){
                    if(a[i]< a[i+1]){
                        if(a[i+1]>2*a[i]){
                            vector<ll> temp;
                            for(int j=0;j<=i;j++)
                            temp.push_back(a[j]);
                            temp.push_back(2*a[i]);
                            for(int j=i+1;j<a.size();j++)
                            temp.push_back(a[j]);
                            a=temp;
                            con = true;
                            // cout<<i<<endl;
                            cnt++;
                            break;
                        }

                    }
                    else if(a[i]>a[i+1]){
                        if(a[i]>2*a[i+1]){
                            vector<ll> temp;
                            for(int j=0;j<=i;j++)
                            temp.push_back(a[j]);
                            temp.push_back(2*a[i+1]);
                            for(int j=i+1;j<a.size();j++)
                            temp.push_back(a[j]);
                            con = true;
                            a=temp;
                            //cout<<i<<endl;
                            cnt++;
                            break;
                        }

                    }
                }
                 //cout<<con<<endl;
                if(!con)
                break;


            }
            cout<<cnt<<"\n";



        }

}

