#include <bits/stdc++.h>
using namespace std;
int Set(int mask, int pos) { return mask = mask | (1 << pos); }
bool check(int mask, int pos) { return (bool)(mask & (1 << pos)); }
int arr[100005], rangeMin[100005];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int test, n;
  cin >> test;
  while (test--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      rangeMin[i] = 2147483647;
    }
    rangeMin[n] = 2147483647;
    for (int i = n - 1; i >= 0; i--) {
      rangeMin[i] = min(rangeMin[i + 1], arr[i]);
    }
    int maxD = 0;
    bool found = false;
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] >= rangeMin[i]) {
        found = true;
        int d = arr[i] - rangeMin[i];
        maxD = max(maxD, d);
      }
    }
    if (!found) {
      cout << 0 << endl;
    } else {
      int cnt = 0;
      while (maxD) {
        cnt++;
        maxD /= 2;
      }
      cout << cnt << endl;
    }
  }
  return 0;
}
