#include <bits/stdc++.h>
using namespace std;
long long a[100009];
int main() {
  long long i, n, t, k, j, x = 0, y = 0, m;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long ans = 0;
  cin >> t;
  while (t--) {
    ans = 0;
    cin >> n;
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n - 1; i++) {
      if (a[i + 1] >= a[i]) continue;
      x = 0;
      y = abs(a[i + 1] - a[i]);
      while (y != 0) {
        y = y / 2;
        x++;
      }
      ans = max(ans, x);
      a[i + 1] = a[i];
    }
    cout << ans << "\n";
  }
  return 0;
}
