#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    cin >> n;
    vector<long long> v(n, 0);
    long long count = 0, m = 1, h = 0, ma = 0;
    for (long long j = 0; j < n; j++) {
      cin >> v[j];
    }
    for (long long j = 0; j < n - 1; j++) {
      if ((v[j + 1] - v[j]) < 0) {
        count = v[j] - v[j + 1];
        ma = max(ma, count);
        v[j + 1] = count + v[j + 1];
      }
    }
    for (long long j = 0;; j++) {
      if (h >= ma) {
        cout << j << "\n";
        break;
      }
      h += m;
      m = m * 2;
    }
  }
  return 0;
}
