#include <bits/stdc++.h>
using namespace std;
int n, m, Ttest;
int a[212345], f[212345];
int main() {
  ios::sync_with_stdio(0);
  cin >> Ttest;
  while (Ttest--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    int Cmax = a[1];
    int d = 0;
    for (int i = 2; i <= n; i++) {
      Cmax = max(Cmax, a[i]);
      d = max(d, Cmax - a[i]);
    }
    int kq = 0;
    int dem = 1;
    while (d > 0) {
      kq += dem;
      d = d / 2;
    }
    cout << kq << endl;
  }
  return 0;
}
