#define _CRT_SECURE_NO_WARNINGS
#define first ff
#define second ss
#define make_pair mp
#define push_back pb
#define pop_back pop

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <cmath>
#include <utility>
#include <iomanip>
#include <queue>

using namespace std;

using vi = vector<int>;
using pii = pair<int, int>;
using ll = long long;
using vll = vector<ll>;

void solve() {
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        int n;
        cin >> n;
        vi a(n);
        for (auto& elem : a) {
            cin >> elem;
        }

        int count = 0;
        for (int j = 0; j + 1 < n; ++j) {
            if (max(a[j], a[j + 1]) > 2 * min(a[j], a[j + 1])) {
                if (a[j] > a[j + 1]) {
                    int tmp = a[j];
                    while (tmp > 2 * a[j + 1]) {
                        tmp = ceil(tmp / 2.0);
                        count++;
                    }
                }
                else {
                    int tmp = a[j + 1];
                    while (tmp > 2 * a[j]) {
                        tmp = ceil(tmp / 2.0);
                        count++;
                    }
                }
            }
        }

        cout << count << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

#ifdef _DEBUG
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif 

    solve();

    return 0;
}