#include <bits/stdc++.h>
#define ii pair<int, int>
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
const int MaxN = 2e5+ 7;
const int oo = 1000000000;
const int Mod = 1e9 + 7;

void in()
{
    fast    
    //freopen("I.inp", "r",stdin);
    //freopen("O.out", "w",stdout);
}int main()
{
    in();
    int t;
    cin >> t;
    while (t --)
    {
        int n;
        cin >> n;
        int a[n + 1];
        for (int i = 1; i<=n; i++)
            cin >> a[i];
        int res= 0 ;
        for (int i = 2; i<=n; i++)
        {
            int x = max(a[i], a[i - 1]), y = min(a[i], a[i-1]);
            while ((double) x / y > 2)
            {
                res ++ ;
                y *= 2;
            }
        }
        cout << res << '\n';
    }
    return 0;
}