#include <bits/stdc++.h>

using namespace std;

bool isDense(int a, int b) {
  return (double(max(a, b)) / min(a, b)) <= 2;
}

int main() {

  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int t;
  cin >> t;

  while (t--) {

    int n;
    cin >> n;

    vector<int> arr;

    bool isArrDense = true;

    for (int i = 0; i < n; i++) {

      int a;
      cin >> a;

      arr.push_back(a);

      if (isArrDense && i > 0)
        isArrDense = isDense(arr[i - 1], arr[i]);

    }

    if (isArrDense) {

      cout << 0 << endl;

    } else {

      int inserts = 0, lastIndex = 0;

      while (!isArrDense) {

        isArrDense = true;

        for (; lastIndex < arr.size() - 1; lastIndex++) {

          if (!isDense(arr[lastIndex], arr[lastIndex + 1])) {

            inserts++;
            isArrDense = false;

            arr.insert(arr.begin() + lastIndex + 1, min(arr[lastIndex], arr[lastIndex + 1]) * 2);

            break;

          }

        }

      }

      cout << inserts << endl;

    }

  }

  return 0;

}