#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T = 1, n, m, i, j, k;
  cin >> T;
  while (T-- > 0) {
    cin >> n;
    long long A[n];
    for (auto& x : A) cin >> x;
    long long ans = 0;
    for (i = 1; i < n; i++) {
      if (A[i] < A[i - 1]) {
        m = A[i - 1] - A[i];
        m = 64 - __builtin_clzll(m);
        ans = max(ans, m);
        A[i] = A[i - 1];
      }
    }
    cout << ans << '\n';
  }
}
