#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int prev;
    cin >> prev;
    int mdiff = 0, x;
    for (int i = 0; i < n - 1; i++) {
      cin >> x;
      mdiff = max(mdiff, prev - x);
      prev = max(prev, x);
    }
    int ris = 0;
    while (mdiff) {
      ris++;
      mdiff >>= 1;
    }
    cout << ris << "\n";
  }
}
