#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  int n;
  while (t--) {
    cin >> n;
    long long a[n];
    priority_queue<int> mq;
    long long ma, md = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i) {
        ma = max(ma, a[i]);
        md = max(md, ma - a[i]);
      } else
        ma = a[i];
    }
    long long res = 0;
    while (md > 0) {
      res++;
      md >>= 1;
    }
    cout << res << endl;
  }
  return 0;
}
