#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, a[100005];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    int mx = a[0], d = INT_MIN, i, c = 0;
    for (i = 1; i < n; i++) {
      d = max(mx - a[i], d);
      mx = max(a[i], mx);
    }
    d = max(d, 0);
    while (d) {
      d /= 2;
      c++;
    }
    cout << c << endl;
  }
}
