#include<bits/stdc++.h>
using namespace std;
const int N = 2000005;
const int mod = 1e9 + 7;
#define pa pair<int, int>
#define ll long long
#define rep(i, a, b) for(int i=(a);i<=(b);++i)
#define per(i, a, b) for(int i=(a);i>=(b);--i)
#define ms(a, b) memset(a, b, sizeof a)
int a[N], sum[N], vis[N];
int T, n;
ll ans = 2e18;
char s[N];
int main()
{
	cin >> T;
	while(T--){
		cin >> n;
		rep(i, 1, n)cin >> a[i];
		int ans = 0;
		rep(i, 2, n){
			int ma = max(a[i], a[i - 1]), mi = min(a[i], a[i - 1]);
			while(ma > 2 * mi)mi *= 2, ans++;
		}
		cout << ans << "\n";
	}
}