#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long int max = a[0], d = 0;
    for (long long int i = 1; i < n; i++) {
      if (a[i] > max)
        max = a[i];
      else {
        long long int diff = max - a[i];
        if (diff >= d) {
          d = diff;
        }
      }
    }
    cout << ceil(log2(d + 1)) << endl;
  }
}
