#pragma GCC_OPTIMIZE("ofast")
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <set>
using namespace std;

#define all(c) (c).begin(), (c).end()
using ll = long long;
using ld = long double;

void solve() {
    int n; cin >> n;
    vector<int> a(n);
    for (auto& it : a) cin >> it;
    int ans = 0;
    for (int i = 0; i < n - 1; ++i) {
        int x = max(a[i], a[i + 1]), y = min(a[i], a[i + 1]);
        if ((double)x / y <= 2) continue;
//        cout << (double)max(a[i], a[i + 1]) / min(a[i], a[i + 1]) << '\n';
        else {
            while ((double)x / y > 2) {
                y *= 2; ans++;
            }
        }
    }
    cout << ans << '\n';
}

int main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);
    cout.tie(0);
    int tt;
    cin >> tt;
    while (tt--) solve();

    return 0;
}