#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    long long b, c;
    double diff, max;
    cin >> c;
    diff = 0.0;
    max = 0.0;
    for (int i = 1; i < n; i++) {
      cin >> b;
      if (b < c) {
        diff = c - b;
        b += (long long)diff;
        max = max < diff ? diff : max;
      }
      c = b;
    }
    if (max == 0.0) {
      cout << "0\n";
      continue;
    }
    long long m = (int)floor(log2(max));
    cout << (m + 1) << "\n";
  }
  return 0;
}
