#include <bits/stdc++.h>
using namespace std;
long long t, n, a[100005], p[100];
void sol() {
  cin >> n;
  for (long long i = (1); i <= (n); ++i) cin >> a[i];
  long long ans = 0;
  for (long long i = (2); i <= (n); ++i) {
    if (a[i] < a[i - 1]) {
      long long tt = a[i - 1] - a[i];
      a[i] = a[i - 1];
      for (long long j = (0); j <= (31); ++j) {
        if (tt <= p[j]) {
          if (ans < j) ans = j;
          break;
        }
      }
    }
  }
  cout << ans << "\n";
}
int main() {
  for (long long i = (0); i <= (31); ++i) p[i] = (1 << i) - 1;
  cin >> t;
  while (t--) sol();
  return 0;
}
