#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back

using namespace std;
ll  n ,  m , cnt, ans;
ll mx , c , d , a = 1;
string s , s1;
map<char , ll>mp;
int main()
{
    ios_base::sync_with_stdio(0);
    ll T;
    cin >> T;
    while( T -- ){
        cin >> n;
        ll arr[n + 1];
        ll mn = 0 , mx = 0 , cnt = 0;
        for( int i = 1;i <= n;i ++ )
            cin >> arr[i];
        for( int i = 1;i < n;i ++ ){
            mn = min(arr[i] , arr[i + 1]);
            mx = max(arr[i] , arr[i + 1]);
            while(mn * 2 < mx)
                mn*=2 , cnt ++;
        }
        cout << cnt << endl;
    }
}
