#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long d = 0;
  for (long long i = 1; i < n; i++) {
    if (a[i] >= a[i - 1]) continue;
    d = max(d, a[i - 1] - a[i]);
    a[i] = a[i - 1];
  }
  long long ans = 0;
  while (d) {
    ans++;
    d /= 2;
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
}
