#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define mkp(x, y) make_pair(x, y)
#define pb push_back
#define F first
#define S second
	
using namespace std;
typedef long long ll;

const int N = (ll) 1e6 + 1;
const int inf = (ll) 1e9 + 1;

ll t = 1, a[N];

void solve() {
	ll n, cnt = 0;
	cin >> n;
	for(ll i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for(ll i = 1; i <= n - 1; i++) {
		double x = max(a[i], a[i+1]), y = min(a[i], a[i+1]);
		while(x / y > 2) {
			y*=2;
//			cout << y << " ";
			cnt++;
		}
	}
	cout << cnt << '\n';
}

int main() {
ios_base::sync_with_stdio(0);
    cin.tie(0);
/*
	freopen(".in", "r", stdin);  
	freopen(".out", "w", stdout);
*/	
	cin >> t;
	while(t--) {
		solve();
	}
  	return 0;
}
//ìàë