#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N];
int solve(long long x) {
  long long ans = 0, sum = 1;
  for (int i = 1;; i++) {
    ans += sum;
    if (ans >= x) return i;
    sum *= 2;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    memset(b, 0, sizeof(b));
    for (int i = 0; i < n; i++) cin >> a[i];
    int ans = 0;
    for (int i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) {
        long long sum = a[i - 1] - a[i];
        a[i] = a[i - 1];
        ans = max(ans, solve(sum));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
