#include <bits/stdc++.h>
using namespace std;
int max(int &a, int &b) { return (a > b ? a : b); }
unsigned long long max(unsigned long long &a, unsigned long long &b) {
  return (a > b ? a : b);
}
int min(int &a, int &b) { return (a < b ? a : b); }
long long int bits_needed(long long int val) {
  long long int count = 0;
  while (val) count++, val >>= 1;
  return count;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 0, n = 0, i = 0;
  long long int val = 0, prev = 0, ans = 0;
  cin >> t;
  while (t-- > 0) {
    ans = 0;
    cin >> n;
    cin >> prev;
    for (i = 1; i < n; i++) {
      cin >> val;
      if (val < prev) {
        ans = max(ans, bits_needed(prev - val));
      } else
        prev = val;
    }
    cout << ans << "\n";
  }
  return 0;
}
