#include <bits/stdc++.h>
const unsigned int MOD = 1000000007;
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long N;
    cin >> N;
    long long A[N];
    for (int i = 0; i < N; i++) cin >> A[i];
    long long max = A[0], dif = -1, k;
    for (int i = 1; i < N; i++) {
      if (max - A[i] >= dif) dif = max - A[i];
      if (A[i] > max) {
        max = A[i];
      }
    }
    if (dif <= 0) dif = 0;
    string S = "";
    while (dif) {
      S += '1';
      dif /= 2;
    }
    long long ans = S.size();
    cout << ans << endl;
  }
  return 0;
}
