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

void readFile(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int main(){
    
    readFile();
    
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    
    int T;
    cin >> T;
    
    while(T--){

    	int n;
    	cin >> n;
    	vector<int> a;
    	for(int i = 0 ; i < n ; ++i){
    		int val;
    		cin >> val;
    		a.push_back(val);
    	}
    	int ans = 0;
    	for(int i = 0 ; i < n - 1 ; ++i){
    		int val1 = max(a[i], a[i + 1]);
    		int val2 = min(a[i], a[i + 1]);
    		while(val1 > val2 * 2){
    			val2 *= 2;
    			++ans;
    		}
    	}
    	cout << ans << '\n';
    }
    return 0;

}