#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n];
    long long mx = -2e9, mn = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (int i = 0; i < n; i++) {
      mx = max(arr[i], mx);
      mn = max(mn, mx - arr[i]);
    }
    long long ans = 0, x = mn;
    if (mn == 0)
      cout << "0\n";
    else
      cout << floor(log2(x)) + 1 << "\n";
  }
  return 0;
}
