#include <bits/stdc++.h>
using namespace std;
int main() {
  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];
    long long count = 0;
    long long k = 0;
    for (long long i = 0; i < n - 1; i++) {
      if (a[i] > a[i + 1]) {
        k = 0;
        long long x = a[i] - a[i + 1];
        a[i + 1] = a[i];
        while (x > 0) {
          x = x / 2;
          k++;
        }
        count = max(count, k);
      }
    }
    cout << count << endl;
  }
}
