#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    int mx, x;
    mx = 0;
    for (int i = 1; i < n; i++) {
      if (arr[i] < arr[i - 1]) {
        x = arr[i - 1] - arr[i];
        if (x > mx) {
          mx = x;
        }
        arr[i] = arr[i - 1];
      }
    }
    int ans = 0;
    while (mx != 0) {
      mx = mx / 2;
      ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
