#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
using namespace std;
const long long N = 2e5 + 10, M = 1e5 + 10, mod = 1000000;
const long long OO = 1e16;
int t, n;
long long mx, A[N];
long long solve(long long x) {
  long long ret = 0;
  while (x) {
    ++ret;
    x /= 2;
  }
  return ret;
}
int main() {
  cin >> t;
  while (t--) {
    mx = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> A[i];
    ;
    for (int i = 1; i < n; ++i) {
      if (A[i] >= A[i - 1]) continue;
      long long diff = A[i - 1] - A[i];
      mx = max(mx, solve(diff));
      A[i] = A[i - 1];
    }
    cout << mx << "\n";
  }
}
