#include <functional>
#include <algorithm>
#include <iostream>
#include <utility>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define x first
#define y second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define lwb lower_bound
#define upb upper_bound
#define mkpr make_pair
#define sqr(a) (((a) * (a)))
#define sz(a) (int)((a).size())
#define bg(a) a.begin()
#define nd(a) a.end()
#define all(a) a.begin() , a.end()
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define double long double
#define joon ios :: sync_with_stdio(false)
typedef long long ll;
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<int,long long int> pil;
typedef pair<long long int,int> pli;
typedef pair<long long int,long long int> pll;
typedef vector<int> vii;
typedef vector<long long int> vli;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<long long int,long long int> > vpll;
typedef vector< pair<long long int,int> > vpli;
typedef vector< pair<int,long long int> > vpil;
typedef set<int>::iterator sitr;
typedef set<int>::reverse_iterator sritr;
typedef set<int>::const_iterator scitr;

const double pi = acos(-1);
const double eps = 1e-7;
const int MAXN = 300*1000+10;
int a[MAXN];

int main() {
    joon;
    cin.tie(0);
    int __;
    cin>>__;
    for(int _=0;_<__;_++) {
        int n;
        cin>>n;
        for(int i=0;i<n;i++) {
            cin>>a[i];
        }
        lli ans=0;
        for(int i=0;i<n-1;i++) {
            int mi=min(a[i],a[i+1]);
            int mx=max(a[i],a[i+1]);
            while(mi*2<mx) {
                ans++;
                mi*=2;
            }
        }
        cout<<ans<<endl;
    }
}