#include<iostream>
#include<cmath>

using namespace std;

int main() {
    int t = 0;
    scanf("%d", &t);

    while(t--){
        int len = 0;
        scanf("%d", &len);

        int previous = -1;

        int result = 0;

        while(len--){
            int n = 0;
            scanf("%d", &n);
            if(previous == -1){
                previous = n;
                continue;
            }

            int min = previous > n ? n : previous;
            int max = previous < n ? n : previous;

            while((double)max / min > 2){
                max = max / 2 + max % 2;
                result++;
            }

            previous = n;
        }

        printf("%d\n", result);
    }
}
	      	 		   		  	    	  			 	