#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n, temp;
    cin >> n;
    long long diff = 0, cur_max;
    cin >> cur_max;
    for (long long i = 1; + i < n; i++) {
      cin >> temp;
      if (temp < cur_max) {
        diff = max(diff, cur_max - temp);
      }
      cur_max = max(temp, cur_max);
    }
    cout << ceil(log2(diff + 1)) << "\n";
  }
  return 0;
}
