#include <bits/stdc++.h>
using namespace std;
int _ = (cout << fixed << setprecision(9), cin.tie(0), ios::sync_with_stdio(0));
using Int = long long;
int main() {
    int T; cin >> T;
    while (T--) {
        int N; cin >> N;
        vector<int> A(N); for (auto &a : A) cin >> a;
        int ans = 0;
        for (int i = 0; i + 1 < N; i++) {
            int a = A[i], b = A[i + 1];
            if (a > b) swap(a, b);
            while (a * 2 < b) {
                ans++;
                a *= 2;
            }
        }
        cout << ans << '\n';
    }
    return 0;
}