#include<iostream>
using namespace std;

int main()
{
   int t;
   cin >> t;
   
   for(int i=1; i<=t; i++)
   {
      int n;
      cin >> n;
      
      int array[n];
      for(int j=0; j<n; j++)
      {
         cin >> array[j];
      }
      
      int count=0;
      
      for(int k=0; k<(n-1); k++)
      {
         if(array[k]>array[k+1])
         {
            int ref = array[k+1];
            while(array[k]>(2*(array[k+1])))
            {
               array[k+1] *= 2;
               count++;
            }
            array[k+1]=ref;
         }
         else
         {
            int ref = array[k];
            while(array[k+1]>(2*(array[k])))
            {
               array[k] *= 2;
               count++;
            }
            array[k]=ref;
         }
      }

      cout << count << endl;
   }
   
   return 0;
}