#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<long long int> arr(n);
  long long int mx, diff = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i == 0) {
      mx = arr[0];
    } else {
      if (arr[i] < mx) {
        long long int cdiff = mx - arr[i];
        diff = max(diff, cdiff);
      } else {
        mx = arr[i];
      }
    }
  }
  if (diff == 0) {
    cout << 0 << "\n";
    return;
  }
  double ans = double(log(diff + 1)) / double(log(2));
  cout << ceil(ans) << "\n";
  return;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
