#include <bits/stdc++.h>
using namespace std;

long long solve(long long n, long long m){
    long long z=1;
    n=(n+1)/2;
    if((n+m-1)/m>2)
        z+=solve(n,m);
    return z;
}
 
int main(){
	int t;
//    t=1;
    cin>>t;
 
    while(t--){
        long long n,m=0,x=0,y=0,z=0,k=1;
        cin>>n;
        
        long long a[n];
        for(int i=0;i<n;i++)cin>>a[i];
        
        for(int i=1;i<n;i++){
            if((max(a[i],a[i-1])+min(a[i],a[i-1])-1)/min(a[i],a[i-1])>2)
                x+=solve(max(a[i],a[i-1]),min(a[i],a[i-1]));
        }
        
            cout<<x;
        
        
        cout<<endl;
            
    }
    
    
    
    return 0;
}

//1 2 3
//4 5 6
//7 8 9
