#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long b[n];
    long long max1 = INT_MIN;
    long long minn = INT_MAX;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      max1 = max(max1, a[i]);
      minn = min(minn, a[i]);
    }
    long long maxx = 0;
    minn = a[0];
    for (long long i = 1; i < n; i++) {
      if (a[i] < minn) {
        long long diff = abs(a[i] - minn);
        diff += 1;
        long long k = log(diff) / log(2);
        long long c = pow(2, k);
        if (c < diff) {
          k++;
        }
        maxx = max(maxx, k);
      } else {
        minn = a[i];
      }
    }
    cout << maxx << "\n";
  }
  return 0;
}
