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

ll gcd(ll a ,ll b){
    if(b==0)return a;
    return gcd(b , a%b);
}
void solve(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    if(n==1){
        cout<<"0\n";return;
    }
    int c=0;
    for(int i=1;i<n;i++){
        if(2*min(a[i-1],a[i]) < max(a[i-1],a[i]) ){
            int x = min(a[i-1],a[i]);
            int y = max(a[i-1],a[i]);
            while(2*x < y){
                x*=2;
                c++;
            }
        }
    }
    cout<<c<<'\n';
    
}

int main() {
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    int T;
    cin>>T;
    while(T--){
       solve();
    }
    return 0;
}