#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    long long int diff = 0;
    long long int m = 0;
    long long int mx = -1;
    for (long long int i = 0; i < n; i++) {
      diff = arr[i + 1] - arr[i];
      if (diff > 0) continue;
      diff = -1 * diff;
      m = log2(diff);
      mx = max(mx, m);
      arr[i + 1] = arr[i];
    }
    cout << mx + 1;
    cout << endl;
  }
  return 0;
}
