#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
int T, n, a[N];
int main() {
  for (scanf("%d", &T); T--;) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", a + i);
    int maxn = a[1], ans = 0, k = 0;
    for (int i = 2; i <= n; i++)
      ans = max(ans, maxn - a[i]), maxn = max(maxn, a[i]);
    while (ans > 0) k++, ans >>= 1;
    cout << k << '\n';
  }
  return 0;
}
