            #include <bits/stdc++.h>
            using namespace std;
            #define int long long
            #define fi first
            #define se second
            #define pi pair<int,int>  
            #define pb push_back
                        
            static bool cmp(vector<int> &a,vector<int> &b){
                double aa = a[0];
                double bb = a[1];

                double x = (double)a[0]/(double)a[1];
                double y = (double)b[0]/(double)b[1];

                return x>y;

            }


            
            int32_t main(){
                

                int tt;cin>>tt;
                int mod = 1000000000+7;

                while( tt-- ){
                    int n;
                    cin>>n;
                    vector<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 t = max(a[i],a[i+1]);
                        int x = min(a[i],a[i+1]),c=0;
                        while( t>2*x ){
                            c++;
                            x = x*2;
                        }
                        ans += c;
                       // cout<<t<<" ";
                    }
                   
                    cout<<ans<<endl;

                }

                return 0;

            }
                                
