#include <bits/stdc++.h>
using namespace std;
long long int f(long long int n) {
  n--;
  n = n | (n >> 1);
  n = n | (n >> 2);
  n = n | (n >> 4);
  n = n | (n >> 8);
  n = n | (n >> 16);
  return n + 1;
}
int main() {
  long long int i, j, n, t, k, s, c;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int a[n];
    for (i = 0; i < n; i++) cin >> a[i];
    long long int diff;
    long long int b[n];
    b[0] = a[0];
    diff = b[0] - a[0];
    for (i = 1; i < n; i++) {
      if (a[i] < b[i - 1])
        b[i] = b[i - 1];
      else
        b[i] = a[i];
      diff = max(diff, b[i] - a[i]);
    }
    if (diff == 0)
      cout << 0 << endl;
    else {
      s = 0;
      c = 0;
      k = 1;
      while (s < diff) {
        s += k;
        k *= 2;
        c++;
      }
      cout << c << endl;
    }
  }
}
