#include <bits/stdc++.h>

using namespace std;

int main(){
    //ifstream cin("input.txt");
    //ofstream cout("output.txt");
    int t;
    cin >> t;
    for(int i1 = 0; i1 < t; i1++){
        int n;
        cin >> n;
        vector <int> a(n);
        for(int i = 0; i < n; i++){
            cin >> a[i];
        }
        int i = 0, k = 0;
        while(i < n - 1){
            int x = a[i], y = a[i + 1];
            if(x > y){swap(x, y);}
            while(x * 2 < y){
                x *= 2;
                k++;
            }
            i++;
        }
        cout << k << endl;
    }
    //cin.close();
    //cout.close();
    return 0;
}
