#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n);
    for (long long int i = 0; i < n; i++) cin >> v[i];
    long long int max = -1;
    for (long long int i = 1; i < n; i++) {
      if (v[i] - v[i - 1] < 0) {
        long long int d;
        d = floor(log2(v[i - 1] - v[i]));
        v[i] = v[i - 1];
        if (d > max) max = d;
      }
    }
    cout << max + 1 << endl;
  }
}
