#include <bits/stdc++.h>
using namespace std;
long long a[100005];
const long long MAXN = 1e9 + 6;
int main() {
  int n;
  long long maxn = -MAXN, mn = 0;
  cin >> n;
  while (n--) {
    maxn = -MAXN;
    int m, t = 0;
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> a[i];
      if (a[i] > maxn) {
        maxn = a[i];
      }
      if (maxn - a[i] > mn) mn = maxn - a[i];
    }
    for (; mn; mn >>= 1, t++)
      ;
    cout << t << endl;
  }
}
