#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define ll long long
#define min3(a,b,c) min(min((a),(b)),(c))
#define min4(a,b,c,d) min(min((a),(b)),min((c),(d)))
#define max3(a,b,c) max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define S second
#define F first
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define PI 3.14159265358979323846;
#define MOD 1000000007
using namespace std;

int main()
{
    FAST;

    int t;
    cin >> t;

    while(t--)
    {
        int n;
        cin >> n;

        vector <int> a(n);

        for(int i = 0; i < n; i++)
        {
            cin >> a[i];
        }

        int c = 0;

        for(int i = 0; i < n -1; i++)
        {
            int x = min(a[i], a[i+1]);
            int y = max(a[i], a[i+1]);

            while(x * 2 < y)
            {
                x *= 2;
                c += 1;
            }
        }

        cout << c << "\n";
    }
    
    return 0;
}