#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, x, y, z, i, j, m, k, p, q, l, r, diff, num, k1, k2;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n;
    long long a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long ans = 0;
    for (i = 1; i < n; i++) {
      diff = a[i] - a[i - 1];
      if (diff >= 0) {
        continue;
      } else {
        num = abs(diff - 0);
        {
          k1 = ceil(log2(num));
          k2 = floor(log2(num));
          if (k1 == k2) {
            ans = max(ans, 1 + k1);
          } else {
            ans = max(ans, k1);
          }
          a[i] = a[i] + num;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
