#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 1e9+7
using namespace std;

bool compare(pair<ll,ll> p1,pair<ll,ll> p2){
    return p1.ff>p2.ff;
}

int main() {
	ll t;
	cin>>t;
    // t=1;
    
	while(t--)
	{
	    ll n;
	    cin>>n;
	    ll a[n];
	    for(ll i=0;i<n;i++){
	        cin>>a[i];
	    }
	    ll cnt=0;
	    for(ll i=0;i<n-1;i++){
	        if((max(a[i],a[i+1]) + min(a[i],a[i+1]) -1)/min(a[i],a[i+1]) > 2){
	           // cout<<i<<endl;
	            ll  num=min(a[i],a[i+1]);
	           while(num*2<max(a[i],a[i+1])){
	               cnt++;
	               num*=2;
	               //cout<<num<<endl;
	           }
	        }
	    }
	    cout<<cnt<<endl;
	}
	return 0;
}