#include <bits/stdc++.h>
using namespace std;
long long int po(long long int A) {
  if (A == 0) return 0;
  if (A == 1) return 1;
  long long int p = 1, x = 0;
  while (p <= A) {
    p *= 2;
    x++;
  }
  return x;
}
int main() {
  long long int t, n, x;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long int> v, st;
    long long int max_q = INT_MIN;
    for (long long int i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    for (long long int i = 1; i < n; i++) {
      if (v[i - 1] > v[i]) {
        long long int diff = v[i - 1] - v[i];
        v[i] = v[i - 1];
        long long int q = po(diff);
        if (q > max_q) max_q = q;
      }
    }
    if (max_q != INT_MIN)
      cout << max_q << endl;
    else
      cout << 0 << endl;
  }
  return 0;
}
