#include <bits/stdc++.h>
#define ll long long  
#define endl "\n"
using namespace std;

void solve(){
int n;
  cin >> n;
  int last;
  cin >> last;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    int nw;
    cin >> nw;
    int a = min(last, nw), b = max(last, nw);
    while (a * 2 < b) {
      ans++;
      a *= 2;
    }
    last = nw;
  }
  cout << ans << "\n";
}
int main() {
  // your code goes here
  
  ll tc;
  cin>>tc;
  while(tc--){
      solve();
  }
  return 0;
}