#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> arr(n);
    for (long long i = 0; i < n; i++) cin >> arr[i];
    long long mx = -1;
    for (long long i = 1; i < n; i++) {
      if (arr[i] < arr[i - 1]) {
        long long dif = arr[i - 1] - arr[i];
        long long curr = (long long)log2(dif);
        mx = max(mx, curr);
        arr[i] = arr[i - 1];
      }
    }
    cout << mx + 1 << endl;
  }
}
