#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int l;
#define fastIO              ios::sync_with_stdio(false), cin.tie(0)
#define pf                  push_front
#define pb                  push_back
#define popb                pop_back()
#define popf                pop_front()
#define loop(i,n)           for(int i=0;i<n;i++)
#define loope(i,n)           for(int i=0;i<=n;i++)
#define loop1(i,n)           for(int i=1;i<n;i++)
#define loops(i,x,n)        for(int i=x;i<n;i++)
#define loopr(i,n)          for(int i=n-1;i>=0;i--)
#define loop1e(i,n)          for(int i=1;i<=n;i++)
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define vc vector
#define vll vector<long long>
#define pll pair<long long,long long>
#define eb emplace_back
#define pb push_back
//#define mp make_pair
#define INT_BITS 32
#define  st                  l t; cin>>t;
#define  sn                  l n; cin>>n;
#define all(x) x.begin(),x.end()
//#define  unordered_map<l,l>  u;
#define MOD1 1000000007
l solve(l a,l b)
{
	l cnt=0;
	while(a<b)
	{
		a=a*2;
		cnt++;
	}
	cnt--;
	return cnt;
}
int main()
{
  #ifndef ONLINE_JUDGE
    //for getting input from input.txt
    freopen("input.txt","r",stdin);
    //for writing output to output.txt
    freopen("output1.txt","w",stdout);
    #endif
    fastIO;
    l t;
    cin>>t;
    while(t--)
    {
    	l n;
    	cin>>n;
    	l a[n];
    	loop(i,n)
    	cin>>a[i];
    	l ans=0;
    	for(l i=0;i<n-1;i++)
    	{
    		l mx = max(a[i],a[i+1]);
    		l mi = min(a[i],a[i+1]);
    		double d = ceil(double(mx)/mi);
    		if(d<=2)
    			continue;
    		else
    		{
    			ans+=solve(mi,mx);

    		}

    	}
    	cout<<ans<<endl;

    }
 
    return 0;
}
