#include <bits/stdc++.h>
using namespace std;
long long a[150000], Fmax[150000];
long long second(long long x) {
  long long p = 1;
  long long sec = 0;
  while (p <= x) {
    sec++;
    p = p * 2;
  }
  return sec;
}
void process() {
  long long i, n, j;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  Fmax[0] = -1000000001;
  for (i = 1; i <= n; i++) Fmax[i] = max(Fmax[i - 1], a[i]);
  long long kq = 0;
  for (i = 1; i <= n; i++) kq = max(kq, second(Fmax[i] - a[i]));
  cout << kq << endl;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, t;
  cin >> t;
  for (i = 1; i <= t; i++) process();
  return 0;
}
