#include<bits/stdc++.h>
using namespace std;
#define forr(i,a,n)     for(long long int i=a; i<n; i++)
#define loop(i,a,n)     for(long long int i=a; i>=n; i--) 

int main()
{
	ios_base :: sync_with_stdio(false),cin.tie(NULL);

	int m; cin>>m; while(m--)
	{
		int a;
		cin>>a;
		int b[a], ans=0;
		forr(i, 0, a)
			cin>>b[i];
		forr(i, 1, a)
		{
			long long int mn=min(b[i], b[i-1]), mx=max(b[i], b[i-1]);
			while(mx>2*mn)
			{
				ans++;
				mn*=2;
			}
		
		}
		cout<<ans<<'\n';
		
	}	
	
	return 0;
}