#include <bits/stdc++.h>
using namespace std;
int const N = 40;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  long long t, n, a, num, rem, rem1, rem3;
  cout << endl;
  cin >> t;
  while (t--) {
    cin >> n;
    long long v[100009];
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
    }
    long long ans = 0, rem;
    for (int i = 0; i < n - 1; ++i) {
      int v1 = v[i + 1], v2 = v[i];
      if (v[i + 1] < v[i]) {
        rem = v[i] - v[i + 1];
        v[i + 1] = v[i];
        ans = max(ans, rem);
      }
    }
    cout << ceil((double)log2(ans + 1)) << endl;
  }
  return 0;
}
