#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, Max, s = 0, now = 1, res = 0;
  cin >> n;
  vector<long long> V(n);
  for (int i = 0; i < n; i++) cin >> V[i];
  Max = V[0];
  for (int i = 0; i < n; i++) {
    if (V[i] > Max) {
      Max = V[i];
    } else {
      s = max(s, Max - V[i]);
    }
  }
  while (s > 0) {
    s -= now;
    now *= 2;
    res++;
  }
  cout << res << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
