#include <bits/stdc++.h>
using namespace std;
int logtwo(int n) {
  int t = n;
  int ans = 0;
  while (t > 0) {
    ans++;
    t = t / 2;
  }
  return ans - 1;
}
int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  for (int I = 0; I < N; I++) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v.push_back(a);
    }
    int maxmt = v[0];
    int maxm = 0;
    for (int i = 0; i < v.size(); i++) {
      maxmt = max(maxmt, v[i]);
      maxm = max(maxm, maxmt - v[i]);
    }
    if (maxm != 0) {
      cout << logtwo(maxm) + 1 << endl;
    } else {
      cout << "0" << endl;
    }
  }
  return 0;
}
