#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int nums[n];
    long long int i, j, temp;
    for (i = 0; i < n; i++) cin >> nums[i];
    if (n == 1)
      cout << 0 << endl;
    else {
      i = 0;
      vector<long long int> diff;
      while (i < n - 1) {
        while (nums[i] <= nums[i + 1] && i < n - 1) i++;
        temp = nums[i];
        while (nums[i] <= temp && i < n - 1) {
          diff.push_back(temp - nums[i]);
          i++;
        }
      }
      if (nums[n - 1] <= temp) diff.push_back(temp - nums[n - 1]);
      long long int maxdiff = *max_element(diff.begin(), diff.end());
      if (maxdiff == 0)
        cout << 0 << endl;
      else
        cout << (long long int)log2(maxdiff) + 1 << endl;
    }
  }
}
