#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int v[N];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &v[i]);
    int maxx = v[0];
    int ans = -1;
    for (int i = 1; i < n; i++) {
      if (v[i] > maxx)
        maxx = v[i];
      else
        ans = std::max(ans, maxx - v[i]);
    }
    if (ans == -1) {
      printf("0\n");
      continue;
    }
    int p = 0;
    while (ans) {
      p++;
      ans /= 2;
    }
    printf("%d\n", p);
  }
  return 0;
}
