#include <iostream>

using namespace std;
int a[51];
int main()
{
    int t,n,i,j,minim,maxim,aux,cnt;
    cin>>t;
    for(i=1;i<=t;++i)
    {
        cin>>n;
        cnt=0;
        for(j=1;j<=n;++j)
        {
            cin>>a[j];
        }
        for(j=1;j<=n-1;j++)
        {
            minim=a[j];
            maxim=a[j+1];
            if(minim>maxim)
            {
                swap(maxim,minim);
            }
            while(maxim>2*minim)
            {
                minim*=2;
                cnt++;
            }
        }
        cout<<cnt<<'\n';
    }
    return 0;
}
