#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
void solve() {
  int n;
  cin >> n;
  VL a(n);
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  VL add(n);
  for (int i = (1); i < (n); ++i) {
    add[i] = max(0LL, (a[i - 1] + add[i - 1]) - a[i]);
  }
  LL mx = *max_element(add.begin(), add.end());
  int ans = 0;
  while (mx > 0) {
    ans++;
    mx /= 2;
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
