#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
long long a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    int lst = -1;
    for (int i = 1; i < n; i++) {
      if (a[i] >= a[i - 1]) continue;
      long long hold = a[i - 1] - a[i];
      int cnt = -1;
      while (hold) {
        hold >>= 1;
        cnt++;
      }
      lst = max(lst, cnt);
      a[i] = a[i - 1];
    }
    cout << lst + 1 << '\n';
  }
  return 0;
}
