#include <iostream>
#include <bits/stdc++.h>

using namespace std;
void solve(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    int ans=0;
    for(int i=0;i<n-1;i++){
        int k1=max(a[i],a[i+1]);
        int k2=min(a[i],a[i+1]);
        int x=2,y=0;
        while(k2*x<k1){
            x=x*2;
            y++;
            
        }
        
        ans+=y;
    }
    cout<<ans<<endl;
    
}

int main() {
   int t;
   cin>>t;
   while(t--)
   solve();
}