#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e9;
void fast() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
}
int arr[100000];
void solve(int test_case) {
  int n;
  long long ans, maxv;
  ans = 0;
  maxv = 0;
  scanf("%d", &n);
  scanf("%d", &arr[0]);
  for (int i = 1; i < n; i++) {
    scanf("%d", &arr[i]);
    if (arr[i - 1] > arr[i]) {
      long long x = arr[i - 1] - arr[i];
      maxv = max(maxv, x);
      arr[i] = arr[i - 1];
    }
  }
  for (long long i = 1; (i << ans) <= maxv; ans++)
    ;
  printf("%lld\n", ans);
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 1; i <= t; i++) solve(t);
}
