#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int testIter = 0; testIter < t; testIter++) {
    int n;
    cin >> n;
    long long a[n];
    long long maxbehind[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    maxbehind[0] = a[0];
    for (int i = 1; i < n; i++) {
      maxbehind[i] = max(maxbehind[i - 1], a[i]);
    }
    long long maxdiff = 0;
    for (int i = 1; i < n; i++) {
      maxdiff = max(maxdiff, maxbehind[i - 1] - a[i]);
    }
    if (maxdiff == 0) {
      cout << 0 << endl;
    } else {
      long long pow = 2;
      int ans = 1;
      while (pow - 1 < maxdiff) {
        pow *= 2;
        ans++;
      }
      cout << ans << endl;
    }
  }
}
