#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
long long T, n, a[500005];
long long get_ans(long long x) {
  x++;
  for (long long i = 0; i <= 60; i++) {
    if ((1LL << i) >= x) return i;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> T;
  while (T--) {
    long long tmp = 0;
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    for (long long i = 2; i <= n; i++) {
      if (a[i] < a[i - 1]) {
        tmp = max(tmp, a[i - 1] - a[i]);
        a[i] = a[i - 1];
      }
    }
    cout << get_ans(tmp) << '\n';
  }
  return 0;
}
