#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define endl "\n"

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int arr[n];
        for (int i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
        int count = 0;
        for (int i = 0; i < n - 1; i++)
        {
            int j = min(arr[i], arr[i + 1]);
            while (ceil((max(arr[i], arr[i + 1]) * 1.0 / j * 1.0)) > 2)
            {
                j = j * 2;
                count++;
            }
        }
        cout << count << endl;
    }

    return 0;
}