#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
long long int getpower(long long int n) {
  if (n == 0) return 0;
  long long int l = floor(log2(n));
  return (l + 1);
}
void solve() {
  long long int a, n, maxx = INT_MIN;
  cin >> n;
  long long int arr[n];
  long long int difmax = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a;
    maxx = max(maxx, a);
    arr[i] = max(0LL, maxx - a);
    difmax = max(difmax, arr[i]);
  }
  cout << getpower(difmax) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
