#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int n;
  cin >> t;
  while (t--) {
    long long int maxi = 0, temp, prev = 0, previ = 0;
    cin >> n;
    cin >> temp;
    previ = temp;
    for (int i = 1; i < n; ++i) {
      cin >> temp;
      if (temp >= previ + prev) {
        prev = 0;
        previ = temp;
      } else {
        prev = previ + prev - temp;
        previ = temp;
      }
      if (maxi < prev) maxi = prev;
    }
    maxi++;
    cout << ceil(log2(maxi)) << endl;
  }
  return 0;
}
