#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, OO = 0x3f3f3f3f;
long long int A[100005];
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, ok = 0, ans = 0;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> A[i];
    for (int i = 0; i < n - 1; i++) {
      long long int d = A[i] - A[i + 1];
      if (d > 0) {
        ok = max(ok, d);
        A[i + 1] = A[i];
      }
    }
    if (ok == 0)
      cout << 0 << endl;
    else {
      long long int ans = 0;
      while (ok) {
        ok /= 2;
        ans++;
      }
      cout << ans << endl;
    }
  }
}
