#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100000;
ll arr[N + 1] = {
    0,
};
ll dp[N + 1] = {
    0,
};
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
int ROW, COL = 0;
int isValid(int y, int x) {
  if (y < 1 || y > ROW || x < 1 || x > COL) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  int n;
  while (t--) {
    cin >> n;
    ll a;
    cin >> a;
    ll mymax = a;
    ll diff = 0;
    for (int i = 2; i <= n; i++) {
      cin >> a;
      if (mymax > a) {
        diff = max(diff, mymax - a);
      }
      mymax = max(mymax, a);
    }
    ll service = 1;
    int ret = 0;
    while (diff > 0) {
      diff -= service;
      service *= 2;
      ret++;
    }
    cout << ret << '\n';
  }
}
