#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long diff = -2e10, mx = -2e10;
  for (int i = 0; i < n; ++i) {
    mx = max(mx, a[i]);
    diff = max(mx - a[i], diff);
  }
  int ans = 0;
  while (diff) {
    diff /= 2;
    ++ans;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
