#define ll long long

#define tes(t) ll t;cin>>t;while(t--) 
#define mp make_pair
#define pb push_back

#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)

#include <bits/stdc++.h>

using namespace std;

int main()
{

  ll t;
  cin>>t;
  while(t--)
  {
    ll n;
    cin>>n;
    vector<int>v;
    rep(i,0,n-1)
    {
      ll x;
      cin>>x;
      v.pb(x);
    }
    ll ans=0;
    rep(i,1,n-1)
    {
      int x=max(v[i],v[i-1]);
      int y=min(v[i],v[i-1]);
      if(x<=2*y)
      continue;
      else
      {
        while((x+1)/2>y)
        {
          ans++;
          x=(x+1)/2;
        }
      }
    }
    cout<<ans<<endl;

  }
  
}
	

  
