#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    long long int arr[100010];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> arr[i];
    long long int mx = arr[0], dis_max = 0;
    for (int i = 1; i < n; i++) {
      mx = max(mx, arr[i]);
      dis_max = max(dis_max, mx - arr[i]);
    }
    int ans = 0;
    while (dis_max != 0) {
      dis_max /= 2;
      ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
