#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long Max = 1000;
int main() {
  long long t;
  cin >> t;
  for (long long q = 0; q < t; q++) {
    long long n;
    cin >> n;
    long long arr[n];
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    long long ans = 0;
    long long currmax = arr[0];
    long long maxdiff = 0;
    for (long long i = 1; i < n; i++) {
      maxdiff = max(maxdiff, currmax - arr[i]);
      currmax = max(currmax, arr[i]);
    }
    if (maxdiff != 0) {
      ans = log2(maxdiff) + 1;
      cout << ans << endl;
    } else
      cout << 0 << endl;
  }
}
