#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500100, MAXK = 30;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
const long double PI = asin(1) * 2;
void setIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
}
void setIO(string second) {
  setIO();
  freopen((second + ".in").c_str(), "r", stdin);
  freopen((second + ".out").c_str(), "w", stdout);
}
int lsb(int x) {
  int cnt = 0;
  while (x) {
    x /= 2;
    cnt++;
  }
  return cnt;
}
int main() {
  setIO();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int last;
    cin >> last;
    int ans = 0;
    for (int O = (1); O <= ((n - 1)); O++) {
      int cur;
      cin >> cur;
      if (cur < last) ans = max(ans, lsb(last - cur));
      last = max(cur, last);
    }
    cout << ans << "\n";
  }
  return 0;
}
