#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, n, i, j, k, mx, diff, x;
  cin >> t;
  for (k = 0; k < t; k++) {
    diff = 0;
    cin >> n;
    long long int a[n];
    for (i = 0; i < n; i++) cin >> a[i];
    mx = a[0];
    for (i = 1; i < n; i++) {
      mx = max(mx, a[i]);
      diff = max(diff, mx - a[i]);
    }
    x = diff;
    j = 0;
    while (diff) {
      diff /= 2;
      j++;
    }
    cout << j << "\n";
  }
  return 0;
}
