#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    int maxNum = -1e9 - 10;
    int maxDiff = 0;
    for (int i = 0; i < n; i++) {
      if (maxNum < v[i]) maxNum = v[i];
      maxDiff = max(maxDiff, maxNum - v[i]);
    }
    int res = 0;
    while (maxDiff > 0) {
      res++;
      maxDiff /= 2;
    }
    cout << res << '\n';
  }
}
