#include <bits/stdc++.h>
using namespace std;
const bool debug = false;
const long long INF = 1000000000000000000LL;
const long long mod = 1000000007;
struct Algo {
  long long n, pop;
  Algo() {
    cin >> n >> pop;
    long long res = 0;
    for (long long a, i = 1; i < n; i++) {
      cin >> a;
      if (a < pop) {
        long long x = pop - a;
        long long pot = 1;
        while (x >>= 1) {
          pot++;
        }
        res = max(res, pot);
      }
      pop = max(pop, a);
    }
    cout << res << "\n";
  }
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    Algo p;
  }
  return 0;
}
