#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
long long sum[100];
int n;
int t;
long long solve(int x) {
  long long cnt = 1;
  long long s = 1;
  while (1) {
    if (s * 2 > x) {
      return cnt;
    }
    s *= 2;
    cnt++;
  }
}
int main() {
  cin >> t;
  long long num = 2;
  sum[0] = 1;
  for (int i = 1; i <= 50; i++) {
    sum[i] = num;
    num *= 2;
  }
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int ans = 0;
    for (int i = 2; i <= n; i++) {
      while (a[i] < a[i - 1]) {
        int p = solve(a[i - 1] - a[i]);
        ans = max(ans, p);
        a[i] += sum[p - 1];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
