#include <bits/stdc++.h>
using namespace std;
long long log2x(long long n) {
  double d = (double)n;
  long long value = 0;
  while (d >= 2.0) {
    d /= 2.0;
    value++;
  }
  return value;
}
int main() {
  long long t, tc;
  cin >> tc;
  for (t = 1; t <= tc; t++) {
    long long n, i, mx = 0, x, ans, flag = 0;
    long long arr[100005];
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (i = 1; i < n; i++) {
      if (arr[i] < arr[i - 1]) {
        x = arr[i - 1] - arr[i];
        ans = log2x(x);
        mx = max(mx, ans);
        arr[i] = arr[i] + x;
        flag = 1;
      }
    }
    if (flag == 1)
      cout << mx + 1 << endl;
    else
      cout << mx << endl;
  }
  return 0;
}
