#include <bits/stdc++.h>
using namespace std;
int bit_length(long long number) {
  int result = 0;
  while (number > 0) {
    number /= 2;
    ++result;
  }
  return result;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> numbers(n);
    for (int i = 0; i < n; i++) {
      cin >> numbers[i];
    }
    int result = 0;
    long long temp;
    for (int i = 1; i < n; i++) {
      temp = numbers[i] - numbers[i - 1];
      if (temp < 0) {
        result = max(result, bit_length(-temp));
        numbers[i] = numbers[i - 1];
      }
    }
    cout << result << '\n';
  }
}
