#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long int m = 0, n, x, y;
    cin >> n;
    cin >> x;
    for (int i = 1; i < n; i++) {
      cin >> y;
      if (x > y) {
        m = max(x - y, m);
      }
      x = max(x, y);
    }
    cout << ceil(log2(m + 1)) << '\n';
  }
}
