#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
const long long MOD = 1e9 + 7;
long long n_bits(long long n) {
  long long x = __builtin_popcount(n);
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, x, y, m = 0;
    cin >> n;
    cin >> x;
    for (long long i = 1; i < n; i++) {
      cin >> y;
      if (y < x) m = max(m, x - y);
      x = max(x, y);
    }
    cout << ceil(log2(m + 1)) << endl;
  }
  return 0;
}
