#include <bits/stdc++.h>
using namespace std;
int const N = 200001;
int t, n, v[N];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int an = 0, bf = 0;
    for (int i = 0, x; i < n; ++i) {
      scanf("%d", &x);
      if (!i) {
        bf = x;
        continue;
      }
      if (x < bf) {
        int df = bf - x;
        int ad = log2(df);
        an = max(an, ad + 1);
        x += ad;
      }
      bf = max(x, bf);
    }
    printf("%d\n", an);
  }
}
