#include <bits/stdc++.h>
using namespace std;
void adder() {
  long long int n, maxi = 0;
  cin >> n;
  long long int arr[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (int i = 1; i < n; ++i) {
    if (arr[i] < arr[i - 1]) {
      maxi = max(maxi, (arr[i - 1] - arr[i]));
      arr[i] = arr[i - 1];
    }
  }
  cout << (int)ceil(log2(maxi + 1)) << "\n";
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    adder();
  }
  return 0;
}
