#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define pb push_back
#define endl '\n';
#define salam  return 0
#define sz(s) int(s.size())
#define Ceil(x,y)  ((x+y-1)/y)
#define all(v) ((v).begin()),((v).end())
#define allr(v) ((v).rbegin()), ((v).rend()) 
#define mem(x,y) memset(x,y,sizeof(x))
#define fix(n)  fixed<<setprecision(n)
#define palindrom(s)  (s==string(s.rbegin(),s.rend()))
#define I64 int 
typedef long long ll;
typedef unsigned long long ull;
typedef double dl;
typedef long double ld;
const ll mod = ll(1e9 + 7);
const double PI = acos(-1.0);
const int N = (int)1e6 * 2, OO = 0x3f3f3f3f;
using namespace std;
void Selim()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int dx[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
int dy[8] = { 1, 0, -1, 0, -1, 1, 1, -1 };
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll LCM(ll a, ll b) { return a / gcd(a, b)*b; }
//ll Mod(ll x, ll m){ return ((x % m) + m) % m; }
ll fact(long long  n) { return !n ? 1 : n * fact(n - 1); }
//transform(s.begin(), s.end(), s.begin(), ::tolower);
//palindrom if(s==string(s.rbegin(),s.rend()))
//memset(arr,0,sizeof arr);   
int main()
{
	Selim();
	int t, n;
	cin >> t;
	while (t--){
		cin >> n;
		vector<int>v(n);
		for (int i = 0; i < n; i++){
			cin >> v[i];
		}
		int cnt = 0, cur = v[0];
		for (int i = 1; i < n; i++){
			if (max(cur, v[i])>2 * min(cur, v[i])){
				if (v[i]>cur){
					cur *= 2;
				}
				else{
					cur = Ceil(cur, 2);
				}
				cnt++; i--;
			}
			else{
				cur = v[i];
			}
		}
		cout << cnt << endl;
	}
	salam;
}