#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 17;
int N, Q;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> Q;
  while (Q--) {
    cin >> N;
    long long mx;
    cin >> mx;
    long long diff = 0;
    while (--N) {
      long long x;
      cin >> x;
      mx = max(mx, x);
      diff = max(diff, mx - x);
    }
    long long ans = 0;
    while (diff) {
      ans++;
      diff >>= 1;
    }
    cout << ans << endl;
  }
  return 0;
}
