#include<iostream>
#include<cmath>
using namespace std;
int a[55];
int main()
{
	int T;
	cin>>T;
	while(T--)
	{
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		int ans=0;
		for(int i=1;i<n;i++)
		{
			double x=double(max(a[i],a[i+1]))/double(min(a[i],a[i+1]));
			while(x>2)
			{
				ans++,x/=2;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
} 
