#include <iostream>
#include <vector>
#include <stack>
#include<bits/stdc++.h>
using namespace std;
const long long int INF = (long long)1e15;
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define all(c) c.begin(),c.end()
#define yes cout<<"YES\n"
#define no cout<<"NO\n"

bool cmp(pair<int,int> &a, pair<int,int> &b)
{
    return a.second>b.second;
}
void solve()
{
    int n;cin>>n;
    int a[n];
    f(i,0,n) cin>>a[i];
    int ans=0;
    f(i,0,n-1)
    {
        int x=min(a[i],a[i+1]), y=max(a[i],a[i+1]);
        if(y>2*x)
        {
            while(2*x<y)
            {
                x*=2;ans++;
            }
        }
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
}



