#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
  cout << '\n';
}
template <typename T>
void print(deque<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
  cout << '\n';
}
template <typename T>
void print(vector<vector<T>>& a) {
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < a[i].size(); j++) cout << a[i][j] << ' ';
    cout << '\n';
  }
}
int n;
void solve() {
  cin >> n;
  vector<int> a(n);
  int m = -1e9;
  int mm = 0;
  for (long long i = 0; i < (n); i++) cin >> a[i];
  for (int x : a) {
    mm = max(mm, m - x);
    m = max(m, x);
  }
  mm += 1;
  cout << ceil(log2(mm)) << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
