#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i;
  cin >> t;
  long long int b[35] = {0};
  b[0] = 1;
  for (i = 1; i < 34; i++) b[i] = 2 * b[i - 1];
  for (i = 1; i < 34; i++) {
    b[i] = b[i] + b[i - 1];
  }
  while (t--) {
    int n;
    cin >> n;
    long long int a[n];
    for (i = 0; i < n; i++) cin >> a[i];
    long long int maxer = a[0];
    vector<long long int> v;
    v.clear();
    for (i = 1; i < n; i++) {
      if (a[i - 1] > maxer) maxer = a[i - 1];
      if (a[i] < a[i - 1]) {
        v.push_back(abs(a[i] - maxer));
      }
    }
    if (v.size() == 0)
      cout << 0 << "\n";
    else {
      sort(v.begin(), v.end());
      int t1 = 0;
      for (i = 0; b[i] < v[v.size() - 1]; i++) t1++;
      cout << t1 + 1 << "\n";
    }
  }
  return 0;
}
