#include <bits/stdc++.h>
using namespace std;
bool comp(long long a, long long b) { return a > b; }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    if (n == 1) {
      cout << 0 << endl;
      continue;
    }
    long long mn[n - 1];
    mn[n - 2] = a[n - 1];
    for (long long i = n - 3; i >= 0; i--) {
      mn[i] = min(mn[i + 1], a[i + 1]);
    }
    long long maxdiff = 0;
    for (long long i = 0; i < n - 1; i++) {
      maxdiff = max(maxdiff, a[i] - mn[i]);
    }
    long long res = ceil(log2((double)(maxdiff) + (double)(1)));
    cout << res << endl;
  }
}
