#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int T, n, lc;
long long a[maxn];
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    lc = -1;
    a[0] = -1e18;
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    for (int i = 1; i <= n; i++)
      if (a[i] >= a[i - 1])
        continue;
      else {
        long long now = a[i - 1] - a[i];
        if (lc != -1 && ((1ll << (lc + 1)) - 1) >= now)
          a[i] += now;
        else {
          int t = lc;
          for (int j = t + 1; j <= 35; j++) {
            lc = j;
            if ((1ll << (j + 1)) - 1 >= now) break;
          }
          a[i] += now;
        }
      }
    printf("%d\n", lc + 1);
  }
  return 0;
}
