#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int t, n, i, mx, delta;
  long long b, c;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    mx = a[1], delta = 0;
    for (i = 2; i <= n; i++) {
      mx = max(mx, a[i]);
      if (a[i] < mx) delta = max(delta, mx - a[i]);
    }
    if (delta == 0) {
      printf("0\n");
      continue;
    }
    b = 0;
    for (i = 1;; i++) {
      if (i == 1)
        c = 1;
      else
        c = c * 2;
      b += c;
      if (b >= delta) break;
    }
    printf("%d\n", i);
  }
  return 0;
}
