#include <bits/stdc++.h>
using namespace std;
int T, n, a[100001], maxo, ans = 0, cur = 0;
long long ts = 0;
int main() {
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    maxo = a[1];
    for (int i = 2; i <= n; i++) {
      if (a[i] < maxo) {
        int j = maxo - a[i], cur = 0;
        while (j > 0) {
          j /= 2;
          cur++;
        }
        ans = max(ans, cur);
      } else
        maxo = a[i];
    }
    cout << ans << endl;
    ans = 0;
  }
}
