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

int main()
{
 int t;
 cin>>t;
 while(t--)
 {
  int n,i;
  cin>>n;
  int arr[n];
  for(i=0;i<n;i++)
  cin>>arr[i];
  int count= 0;
  for(i=0;i<n-1;i++)
  {
    float a,b;
    if(arr[i]>arr[i+1])
    {a=arr[i];b=arr[i+1];}
    else
    {b=arr[i];a=arr[i+1];}
    if((a/b)>2)
    {
        while((b*2)<a)
        {
         b*=2;
         count++;
         
        }
    }
  }
  cout<<count<<endl;
  
 }
 
 
    
}