#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 10;
long long ans[maxn];
long long dif[maxn];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    long long minn = 2e9;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &ans[i]);
    }
    for (int i = 2; i <= n; i++) {
      dif[i] = ans[i] - ans[i - 1];
    }
    long long temp = 0;
    for (int i = n; i >= 2; i--) {
      temp = temp + dif[i];
      temp = min(temp, dif[i]);
      minn = min(temp, minn);
    }
    long long t = -1;
    int ans = 1;
    if (minn >= 0) {
      printf("0\n");
      continue;
    }
    while (t > minn) {
      t *= 2;
      t -= 1;
      ans++;
    }
    printf("%d\n", ans);
  }
}
