#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a, times;
void solve() {
  cin >> n;
  a = vector<int>(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  times = vector<int>(n, 0);
  int last = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] >= last) {
      last = a[i];
      continue;
    }
    int z = ceil(log2(last - a[i] + 1));
    times[i] = z;
    a[i] = last;
    last = a[i];
  }
  int mx = times[0];
  for (int i = 1; i < n; i++) mx = max(mx, times[i]);
  cout << mx;
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
