#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long a[n];
    for (auto &it : a) cin >> it;
    long long x = 0LL;
    for (int i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) {
        long long d = a[i - 1] - a[i];
        long long b = 0, z = d;
        while (z > 0) {
          b++;
          z /= 2;
        }
        a[i] += d;
        x = max(x, b);
      }
    }
    cout << x << "\n";
  }
  return 0;
}
