#include <bits/stdc++.h>
using namespace std;
vector<int> l;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long temp;
    cin >> temp;
    long long diff = 0;
    for (int i = 1; i < n; ++i) {
      long long t;
      cin >> t;
      if (t < temp) {
        diff = max(diff, temp - t);
      } else {
        temp = t;
      }
    }
    int ans = 0;
    while (diff) {
      diff >>= 1;
      ans++;
    }
    cout << ans << endl;
  }
}
