#include <bits/stdc++.h>
using namespace std;
long long int a[500005];
long long int cnt[500005];
vector<long long int> v;
long long int pre[500005];
vector<long long int> vv;
long long int taken[500005];
long long int prime[500005];
bool pr[500005];
set<char> st;
priority_queue<long long int> bob;
priority_queue<long long int> ali;
priority_queue<long long int> bth;
queue<long long int> q;
map<long long int, long long int> mp;
map<long long int, long long int>::iterator it;
map<long long int, vector<long long int> > ck;
string ss, tt[500005];
int main() {
  long long int n, i, j, k, t, pos, m;
  cin >> t;
  long long int minis;
  long long int res;
  long long int x, y;
  long long int pp;
  string fg;
  long long int l, r;
  long long int ans;
  long long int h;
  while (t--) {
    cin >> n;
    res = n;
    long long int mxx = -10e10;
    long long int mxd = -10e11;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > mxx) mxx = a[i];
      mxd = max(mxd, mxx - a[i]);
    }
    long long int po = 1;
    res = 0;
    while (1) {
      if (mxd <= 0) break;
      mxd = mxd - po;
      po = po * 2;
      res++;
    }
    cout << res << '\n';
  }
  return 0;
}
