#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {
        int n;
        cin >> n;
        int ar[n];
        forf(i,0,n)
            cin >> ar[i];
        int ans=-1;
        forf(i,0,n){

                int diff=ar[i+1]-ar[i];
                if(diff>0)
                    continue;
                diff=abs(diff);
                int k = log2(diff);
//                cout << k << endl;

//                forf(i,0,n)
//                cout << ar[i]<<" ";
//                cout << endl;
                ans=max(ans,k);
                ar[i+1]=ar[i];
        }
        cout << ans+1 << endl;

    }
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
# define int long long
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {

       int n;
       cin >> n;
       int arr[n];
       for(int i=0;i<n;i++)
       cin >> arr[i];
       int tre=0;
       int m=0;
       int mx=-1;
       for(int i=0;i<n;i++)
       {
           tre=arr[i+1]-arr[i];
           if(tre>0)
            continue;
           tre=-1*tre;
           m=log2   (tre);
           mx=max(mx,m);
           arr[i+1]=arr[i];

       }

      cout << mx+1;

      cout << endl;
   }

    return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {
        int n;
        cin >> n;
        int ar[n];
        forf(i,0,n)
            cin >> ar[i];
        int ans=0;
        forf(i,1,n){
            if(ar[i]>=ar[i-1])
                continue;
            else {
                int diff=ar[i-1]-ar[i];
                int k = log10(diff)/log10(2);
//                cout << k << endl;

//                forf(i,0,n)
//                cout << ar[i]<<" ";
//                cout << endl;
                if(k<=ans){
                    ans++;
                    ar[i]+=pow(2,ans);
                }
                else {
//                        int p=k-ans;
                    ans=k+1;
                    ar[i]+=pow(2,k);
                }

            }
        }
        cout << ans << endl;

    }
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {

       int n;
       cin >> n;
       int arr[n];
       for(int i=0;i<n;i++)
       cin >> arr[i];
       int tre=0;
       int m=0;
       int mx=-1;
       for(int i=0;i<n;i++)
       {
           tre=arr[i+1]-arr[i];
           if(tre>0)
            continue;
           tre=-1*tre;
           m=log2   (tre);
           mx=max(mx,m);
           arr[i+1]=arr[i];

       }

      cout << mx+1;

      cout << endl;
   }

    return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {
        int n;
        cin >> n;
        int ar[n];
        forf(i,0,n)
            cin >> ar[i];
        int ans=0;
        forf(i,1,n){
            if(ar[i]>=ar[i-1])
                continue;
            else {
                int diff=ar[i-1]-ar[i];
                int k = log10(diff)/log10(2);
//                cout << k << endl;

                ar[i]+=pow(2,k);
//                forf(i,0,n)
//                cout << ar[i]<<" ";
//                cout << endl;
                if(k<=ans)
                    ans++;
                else {
//                        int p=k-ans;
                    ans=k+1;
                }

            }
        }
        cout << ans << endl;

    }
}


#include <bits/stdc++.h>

using namespace std;
# define ll long long int
int main()
{
   ll t;
   cin >> t;
   while(t--)
   {
       ll n;
       cin >> n;
       ll arr[n];
       for(ll i=0;i<n;i++)
       cin >> arr[i];
       ll diff=0;
       ll m=0;
       ll mx=-1;
       for(ll i=0;i<n;i++)
       {
           diff=arr[i+1]-arr[i];
           if(diff>0)
            continue;
           diff=-1*diff;
           m=log2(diff);
           mx=max(mx,m);
           arr[i+1]=arr[i];

       }

      cout << mx+1;

      cout << endl;
   }

    return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {
        int n;
        cin >> n;
        int ar[n];
        forf(i,0,n)
            cin >> ar[i];
        int ans=-1;
        forf(i,0,n){
            if(ar[i+1]>=ar[i])
                continue;
                int diff=ar[i]-ar[i+1];
                int k = log2(diff);
//                cout << k << endl;

//                forf(i,0,n)
//                cout << ar[i]<<" ";
//                cout << endl;
                ans=max(ans,k);
                ar[i+1]=ar[i];
        }
        cout << ans+1 << endl;

    }
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {

       int n;
       cin >> n;
       int arr[n];
       for(int i=0;i<n;i++)
       cin >> arr[i];

       int m=0;
       int mx=-1;
       for(int i=0;i<n;i++)
       {
           int tre=arr[i+1]-arr[i];
           if(tre>0)
            continue;
           tre=-1*tre;
           m=log2   (tre);
           mx=max(mx,m);
           arr[i+1]=arr[i];

       }

      cout << mx+1;

      cout << endl;
   }

    return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {

       int n;
       cin >> n;
       int arr[n];
       for(int i=0;i<n;i++)
       cin >> arr[i];
       int diff=0;
       int m=0;
       int mx=-1;
       for(int i=0;i<n;i++)
       {
           diff=arr[i+1]-arr[i];
           if(diff>0)
            continue;
           diff=-1*diff;
           m=log2(diff);
           mx=max(mx,m);
           arr[i+1]=arr[i];

       }

      cout << mx+1;

      cout << endl;
   }

    return 0;
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define pb push_back
#define mod 1000000007 //998244353
#define all(x) (x).begin(), (x).end()
#define all(x) (x).begin(), (x).end()
#define forf(i,x,y) for(int i=x; i<y; i++)
#define forb(i,x,y) for(int i=x-1;i>=y;i-=2)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define ss second
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const long long N=200005, INF=2000000000000000000;

int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }

int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main()
{
    IOS;
    int testcaseva;
    cin>>testcaseva;
    forf(i,0,testcaseva)
    {
        int n;
        cin >> n;
        int arr[n];
        forf(i,0,n)
            cin >> arr[i];
            int diff=0;
            int m=0;
        int mx=-1;
        forf(i,0,n){

                 diff=arr[i+1]-arr[i];
           if(diff>0)
            continue;
           diff=-1*diff;
           m=log2(diff);
           mx=max(mx,m);
           arr[i+1]=arr[i];
//                cout << k << endl;

//                forf(i,0,n)
//                cout << ar[i]<<" ";
//                cout << endl;
        }
        cout << mx+1 << endl;

    }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll ans=0;
         for(ll i=1;i<n;i++){
            x=arr[i-1]-arr[i];
            if (x<=0)continue;
            ans=max(ans,(ll)floor(log2(x))+1);
            arr[i]+=x;
         }
         cout<<ans<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll ans=0;
         for(ll i=1;i<n;i++){
            x=arr[i-1]-arr[i];
            if (x<=0)continue;
            ans=max(ans,(ll)floor(log2(x))+1);
            arr[i]+=(1<<((ll)floor(log2(x))));
         }
         cout<<ans<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll f(ll n)
{
    for(ll i=0;i<=30;i++)
        if((1<<i)>=n)
        return i;
}
int main()
{
 ios
 ll t;
 cin>>t;
 while(t--)
 {
  ll n,ma=0;
  cin>>n;
  vector<ll> v(n);
  for(ll i=0;i<n;i++)
    cin>>v[i];
  for(ll i=0;i<n-1;i++)
    if(v[i+1]<v[i])
      {ll tt=f(v[i]-v[i+1]);
       v[i+1]=v[i+1]+(1<<tt);
       ma=max(ma,tt+1);
       }
    cout<<ma<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll f(ll n)
{
    for(ll i=0;i<=30;i++)
        if((1<<i)>=n)
        return i;
}
int main()
{
 ios
 ll t;
 cin>>t;
 while(t--)
 {
  ll n,ma=0;
  cin>>n;
  vector<ll> v(n);
  for(ll i=0;i<n;i++)
    cin>>v[i];
  for(ll i=0;i<n-1;i++)
    if(v[i+1]<v[i])
      {ll tt=f(v[i]-v[i+1]);
       v[i+1]=v[i+1]+(1<<tt);
       ma=max(ma,tt+1);
       }
       if(ma==0)
        cout<<ma<<"\n";
       else
    {ll t=(sqrt(2*ma)+1);
    cout<<min(t,ma)<<"\n";}
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll ans=0;
         for(ll i=1;i<n;i++){
            x=arr[i-1]-arr[i];
            if (x<=0)continue;
            ans=max(ans,(ll)floor(log2(x))+1);
            arr[i]+=(1<<((ll)floor(log2(x))));
            if(arr[i]<arr[i-1])
            {arr[i]=arr[i]-(1<<((ll)floor(log2(x))))+(1<<((ll)floor(log2(x))+1));
            ans=max(ans,(ll)floor(log2(x))+2);}
         }
         /*for(ll i=0;i<n;i++)
            cout<<arr[i]<<" ";*/
         cout<<ans<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

int main()
{
 ios
 ll t;
 cin>>t;
 vector<ll> req1,req2;
 for(ll i=0;i<=30;i++)
    req1.push_back((1<<i));
 ll sum=0;
 for(ll j=0;j<=30;j++)
    {sum+=req1[j];req2.push_back(sum);}
 while(t--)
 {
  ll n,ma=0;
  cin>>n;
  vector<ll> v(n);
  for(ll i=0;i<n;i++)
    cin>>v[i];
  for(ll i=0;i<n-1;i++)
    if(v[i+1]<v[i])
      {
        ll in1=lower_bound(all(req1),v[i]-v[i+1])-req1.begin();
        ll in2=lower_bound(all(req2),v[i]-v[i+1])-req2.begin();
        ll tt=min(in1,in2);
        ma=max(ma,tt+1);
        v[i+1]+=(1<<tt);
       }
    cout<<ma<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll diff=0,ma=arr[0];
         for(ll i=1;i<n;i++){
            ma=max(ma,arr[i]);
            diff=max(diff,ma-arr[i]);
         }
         if(diff==0)
            cout<<0<<"\n";
         else
         cout<<(ll)floor(log2(diff))+1<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

int main()
{
 ios
 ll t;
 cin>>t;
 vector<ll> req1,req2;
 for(ll i=0;i<=30;i++)
    req1.push_back((1<<i));
 ll sum=0;
 for(ll j=0;j<=30;j++)
    {sum+=req1[j];req2.push_back(sum);}
 while(t--)
 {
  ll n,ma=0;
  cin>>n;
  vector<ll> v(n);
  for(ll i=0;i<n;i++)
    cin>>v[i];
  for(ll i=0;i<n-1;i++)
    if(v[i+1]<v[i])
      {
        ll in1=lower_bound(all(req1),v[i]-v[i+1])-req1.begin();
        ll in2=lower_bound(all(req2),v[i]-v[i+1])-req2.begin();
        ll tt=min(in1,in2);
        ma=max(ma,tt+1);
        if(in1<in2)
            v[i+1]+=req1[in1];
        else
            v[i+1]+=req2[in2];
       }
    cout<<ma<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll f(ll n)
{
    for(ll i=0;i<=30;i++)
        if((1<<i)>=n)
        return i;
}
int main()
{
 ios
 ll t;
 cin>>t;
 while(t--)
 {
  ll n,ma=0;
  cin>>n;
  vector<ll> v(n);
  for(ll i=0;i<n;i++)
    cin>>v[i];
  for(ll i=0;i<n-1;i++)
    if(v[i+1]<v[i])
      {ll tt=f(v[i]-v[i+1]);
       ll x=min((ll)(sqrt(2*tt))+1,tt);
       v[i+1]=v[i+1]+(1<<x);
       ma=max(ma,x+1);
       }
    cout<<ma<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll ans=0;
         for(ll i=1;i<n;i++){
            x=arr[i-1]-arr[i];
            if (x<=0)continue;
            ans=max(ans,(ll)floor(log2(x))+1);
            arr[i]+=(1<<((ll)floor(log2(x))));
            if(arr[i]<arr[i-1])
                arr[i]=arr[i]-(1<<((ll)floor(log2(x))))+(1<<((ll)floor(log2(x))+1));
         }
         for(ll i=0;i<n;i++)
            cout<<arr[i]<<" ";
         //cout<<ans<<"\n";
 }
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.14159265
#define mod 998244353
#define inf  0x3f3f3f3f
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define prr pair<ll,ll>
#define sz(a) int(a.size())
#define f first
#define s second
#define ios  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
//memset(dis,inf,sizeof(dis));
using namespace std;
ll gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll arr[300000],x;
int main()
{
 ios
 ll t,n;
 cin>>t;
 while(t--)
 {
  cin>>n;
         for(ll i=0;i<n;i++)cin>>arr[i];
         ll ans=0;
         for(ll i=1;i<n;i++){
            x=arr[i-1]-arr[i];
            if (x<=0)continue;
            ans=max(ans,(ll)floor(log2(x))+1);
            arr[i]+=(1<<((ll)floor(log2(x))+1));
         }
         cout<<ans<<"\n";
 }
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){

				p=log2(a[i-1]-a[i]);
				p++;
				sum=p;
				if(sum>ans){
					ans=sum;
				}
				a[i]=a[i-1];
			}
		}

			cout<<ans<<endl;
		}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k;
double sum,ans1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				if(log2(a[i-1]-a[i])>sum)sum=log2(a[i-1]-a[i]);
				k++;
			}
		}

		ans=sum;
		ans1=ans;
		if(ans1<sum)ans++;
		ans+=k;
		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1=0.9999999999998;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				p+=p1;
				sum=p;
				if(sum>ans){
					ans=sum;
				}
			}
		}
		if(l>ans)ans=l;
			cout<<ans<<endl;
		}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				if(p==ans){
					ans++;
					continue;
				}
				if(p>ans){
					p-=ans;
					sum=p;
					p1=sum;
					if(p>p1)sum++;
					ans=sum;
				} else {
					if(l>ans)ans++;
				}
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum;
double p,p1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;ans=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				p=log2(a[i-1]-a[i]);
				p++;
				if(p>ans){
					p-=ans;
					sum=p;
					p1=sum;
					if(p>p1)sum++;
					ans=sum;
				} else {
					ans+=1;
				}
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1=0.9999999999998;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				p+=p1;
				sum=p;
				if(sum>ans+1){
					ans=sum;
				}
			}
		}
		if(l>ans)ans=l;
			cout<<ans<<endl;
		}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				if(p>ans){
					p-=ans;
					sum=p;
					p1=sum;
					if(p>p1)sum++;
					ans=sum;
				} else {
					if(l>ans)ans++;
				}
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				sum=p;
				if(sum>ans){
					ans=sum;
				}
			}
		}

			cout<<ans<<endl;
		}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				sum=p;
				p1=sum;
				if(p>p1)sum++;
				if(sum>ans){
					ans=sum;
				} else if(sum==ans){
					ans++;
				}
			}
		}
		if(ans<l)ans=l;
		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				sum=p;
				if(sum>ans){
					ans=sum;
				}
			}
		}
		if(l>ans)ans=l;
			cout<<ans<<endl;
		}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum;
double p;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		sum=0;k=0;ans=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				p=log2(a[i-1]-a[i]);
				p++;
				if(p>ans){
					p-=ans;
					sum=p;
					if(p>sum)sum++;
					ans+=sum;
				} else {
					ans+=1;
				}
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p,p1;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				p=log2(a[i-1]-a[i]);
				p++;
				sum=p;
				p1=sum;
				if(p>p1)sum++;
				if(sum>ans){
					ans=sum;
				} else if(sum==ans){
					ans++;
				}
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define M (L+R)/2
#define N 500009
#define inf 99999999999
#define ll long long
#define mod 1000000007
#define sz size();
using namespace std;

ll t,n,ans,a[N],k,sum,l;
double p;
int main(){

	ios::sync_with_stdio(0);

	cin>>t;
	while(t--){

		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i];
		}
		ans=0;l=0;
		for(int i=2;i<=n;i++){
			if(a[i]<a[i-1]){
				l++;
				p=log2(a[i-1]-a[i]);
				p++;
				sum=p;
				if(sum>ans){
					ans=sum;
				}
			}
		}
		if(l>ans)ans=l;
			cout<<ans<<endl;
		}

	return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    for(int i = 0; i < n - 1; i++){
      if(arr[i + 1] + currChange < arr[i]){
	while(arr[i + 1] + currChange < arr[i]){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
#include <climits>
using namespace std;
#define MAX 100005

long long arr[MAX];
int main(){

  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    vector<long long> changes;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	if(arr[i - 1] <= arr[i] + currChange)
	  arr[i] = arr[i - 1];
	else
	  while(true){
	    long long newChange = (long long)pow(2, (double)(t - 1));
	    currChange += newChange;

	    arr[i] += newChange;
	    if(arr[i] - arr[i - 1] >= 0)
	      break;
	    t++;
	  }
	arr[i] = arr[i - 1];
      }

    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    vector<long long> changes;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	bool couldBeMore = false;
	for(int j = 0; j < changes.size(); j++){
	  arr[i] += changes[j];
	  if(arr[i] >= arr[i - 1]){
	    couldBeMore = true;
	    break;
	  }
	}
	if(couldBeMore == false){
	  while(arr[i] < arr[i - 1]){
	    t++;
	    long long newChange = (long long)pow(2.0, (double)(t - 1));
	    changes.push_back(newChange);
	    arr[i] += newChange;
	  }
	}
      }
    }

    cout << t<< endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
#include <climits>
using namespace std;
#define MAX 100005

int arr[MAX];
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<int> changes;
  for(int i = 0; i <=31; i++)
    changes.push_back((int)pow(2 , i + 1) - 1);

  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    int currChange = 0;
    int t = 0;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	if(arr[i - 1] <= arr[i])
	  arr[i] = arr[i - 1];
	else
	  while(arr[i - 1] > arr[i] + currChange){
	    currChange = changes[t];
	    t++;
	  }
	arr[i] = arr[i - 1];
      }

    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    for(int i = 0; i < n - 1; i++){

      if(arr[i + 1] + currChange  < arr[i]){
	while(arr[i + 1] + currChange  <  arr[i]){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
      arr[i + 1] += currChange;
    }

    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
int arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    int currChange = 0;
    int t = 0;
    for(int i = 0; i < n - 1; i++){
      if(arr[i + 1] + currChange < arr[i]){
	while(arr[i + 1] + currChange < arr[i]){
	  int newChange = (int)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 1;
    for(int i = 0; i < n - 1; i++){

      if(arr[i + 1] + currChange  < arr[i]){
	while(arr[i + 1] + currChange  <  arr[i]){
	  long long newChange = (long long)pow(2.0, (double)(t - 1));
	  currChange += newChange;
	  t++;
	}
      }
      arr[i + 1] += currChange;
    }

    cout << t - 1<< endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    for(int i = 0; i < n - 1; i++){
      long long thisChange = currChange;
      if(arr[i + 1] + currChange < thisChange + arr[i]){
	while(arr[i + 1] + currChange < thisChange + arr[i]){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
    }

    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    long long max = arr[0];
    for(int i = 0; i < n - 1; i++){
      if(max < arr[i] + currChange)
	max = arr[i] + currChange;
      if(arr[i + 1] + currChange < max){
	while(arr[i + 1] + currChange < max){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
      arr[i + 1] += currChange;
      if(max < arr[i + 1])
	max = arr[i + 1];
    }

    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
#include <climits>
using namespace std;
#define MAX 100005

int arr[MAX];
int main(){

  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    int currChange = 0;
    int t = 0;
    vector<int> changes;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	if(arr[i - 1] <= arr[i] + currChange)
	  arr[i] = arr[i - 1];
	else
	  while(arr[i - 1] > arr[i] + currChange){
	    t++;
	    int newChange = (int)pow(2, (double)(t - 1));
	    currChange += newChange;
	  }
	arr[i] = arr[i - 1];
      }

    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    for(int i = 0; i < n - 1; i++){
      if(arr[i + 1] + currChange < arr[i]){
	while(arr[i + 1] + currChange < arr[i]){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }

     arr[i + 1] += currChange;
    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
using namespace std;
#define MAX 100005

// Runs each test-case.
long long arr[MAX];
int main(){
  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    long long max = arr[0];
    for(int i = 0; i < n - 1; i++){
      if(max < arr[i] + currChange)
	max = arr[i] + currChange;
      if(arr[i + 1] + currChange < max){
	while(arr[i + 1] + currChange < max){
	  long long newChange = (long long)pow(2.0, (double)t) - 1;
	  currChange += newChange;
	  t++;
	}
      }
      arr[i] += currChange;
      if(max < arr[i])
	max = arr[i];
    }

    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
using namespace std;
#define MAX 100005

long long arr[MAX];
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<long long> changes;
  for(int i = 0; i <=31; i++)
    changes.push_back((long long)pow(2 , i + 1) - 1);

  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    long long currChange = 0;
    int t = 0;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	if(arr[i - 1] <= arr[i])
	  arr[i] = arr[i - 1];
	else
	  while(arr[i - 1] > arr[i] + currChange){
	    currChange = changes[t];
	    t++;
	  }
	arr[i] = arr[i - 1];
      }

    }
    cout << t << endl;
  }
  return 0;
}


#include<iostream>
#include "math.h"
#include <vector>
#include <climits>
using namespace std;
#define MAX 100005

int arr[MAX];
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int T;
  cin >> T;
  while(T--){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> arr[i];

    int currChange = 0;
    int t = 0;
    vector<int> changes;
    for(int i = 1; i < n; i++){
      if(arr[i - 1] > arr[i]){
	if(arr[i - 1] <= arr[i] + currChange)
	  arr[i] = arr[i - 1];
	else
	  while(arr[i - 1] > arr[i] + currChange){
	    t++;
	    int newChange = (int)pow(2, (double)(t - 1));
	    currChange += newChange;
	  }
	arr[i] = arr[i - 1];
      }

    }
    cout << t << endl;
  }
  return 0;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 , pos = 0 , add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        while( v1[ i ] + add < v1[ i - 1 ] )
        {
            add += v[ pos ] ;
            pos ++ ;
        }
        v1[ i ] += add ;
    }
    cout << pos << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        v.pb( val ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q ;

void Reset()
{
    v1.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0, pos = 0, add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        if( v1[ i ] < v1[ i - 1 ] )
        {
            add = 0 ;
            pos = 0 ;
            while( v1[ i ] < v1[ i - 1 ] )
            {
                v1[ i ] += v[ pos ] ;
                pos ++ ;
            }
            ans = max( ans, pos ) ;

            ll sum = 0 ;
            for( int j = v.size() - 1 ; j >= 0 ; j -- )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
            }
        }
    }
    cout << ans << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1 ;
    v.pb( val ) ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        val *= 2 ;
        v.pb( val ) ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 , pos = 0 , add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        pos = 0 ;
        //cout << "be " << v1[ i ] << " " << v1[i - 1 ] << endl;
        if( v1[ i ] >= v1[ i - 1 ] )
        {
            continue ;
        }
        else
        {
            add = 0 ;
            //cout << "lis " << v1[ i ] << endl;
            while( v1[ i ] + add < v1[ i - 1 ] )
            {
                add += v[ pos ] ;
                //cout << pos << " " << add + v1[ i ] << endl ;
                pos ++ ;
            }
            ans = max( ans , pos ) ;
            v1[ i ] += add ;
            for( int j = 0 ; j < v.size() ; j ++ )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
                else
                {
                    break ;
                }
            }
           // cout << "add " << v1[ i ] << " " << add << endl ;
        }

    }
    cout << pos << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        v.pb( val ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 , pos = 0 , add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        //cout << "be " << v1[ i ] << " " << v1[i - 1 ] << endl;
        if( v1[ i ] >= v1[ i - 1 ] )
        {
            continue ;
        }
        else
        {
            add = 0 ;
            pos = 0 ;
            //cout << "lis " << v1[ i ] << endl;
            while( v1[ i ] + add < v1[ i - 1 ] )
            {
                add += v[ pos ] ;
                //cout << pos << " " << add + v1[ i ] << endl ;
                pos ++ ;
            }
            ans = max( ans , pos ) ;
            v1[ i ] += add ;
            for( int j = 0 ; j < v.size() ; j ++ )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
                else
                {
                    break ;
                }
            }
            //cout << "add " << v1[ i ] << " " << add << endl ;
        }

    }
    cout << ans << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        v.pb( val ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        if( v1[ i ] < v1[ i - 1 ] )
        {
            ll x = v1[ i - 1 ] - v1[ i ] ;
            ll pos = Lower( v , x ) ;
            ans = max( ans , pos + 1 ) ;
            v1[ i ] += v[ pos ] ;
        }
    }
    cout << ans << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        sum += val ;
        v.pb( sum ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 , pos = 0 , add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        //cout << "be " << v1[ i ] << " " << v1[i - 1 ] << endl;
        if( v1[ i ] >= v1[ i - 1 ] )
        {
            continue ;
        }
        else
        {
            add = 0 ;
            pos = 0 ;
            //cout << "lis " << v1[ i ] << endl;
            while( v1[ i ] + add < v1[ i - 1 ] )
            {
                add += v[ pos ] ;
                //cout << pos << " " << add + v1[ i ] << endl ;
                pos ++ ;
            }
            ans = max( ans , pos ) ;
            v1[ i ] += add ;
            for( int j = 0 ; j < v.size() ; j ++ )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
                else
                {
                    break ;
                }
            }
            //cout << "add " << v1[ i ] << " " << add << endl ;
        }

    }
    cout << pos << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        v.pb( val ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q, mn = INT_MAX, mx = INT_MIN ;

void Reset()
{
    v1.clear() ;
    v2.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0 , pos = 0 , add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        //cout << "be " << v1[ i ] << " " << v1[i - 1 ] << endl;
        if( v1[ i ] >= v1[ i - 1 ] )
        {
            continue ;
        }
        else if( v1[ i ] + add >= v1[ i - 1 ] )
        {
            //cout << "mid " << v1[ i ] << endl ;
            v1[ i ] = v[ i - 1 ] ;
        }
        else
        {
            //cout << "lis " << v1[ i ] << endl;
            while( v1[ i ] + add < v1[ i - 1 ] )
            {
                add += v[ pos ] ;
                //cout << pos << " " << add + v1[ i ] << endl ;
                pos ++ ;
            }
            v1[ i ] += add ;
            for( int j = 0 ; j < v.size() ; j ++ )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
                else
                {
                    break ;
                }
            }
            //cout << "add " << add << endl ;
        }

    }
    cout << pos << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1, sum = 0 ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        v.pb( val ) ;
        val *= 2 ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}


///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ld                     long double
#define          ull                    unsigned long long int
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          ff                     first
#define          ss                     second
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scin3(x,y,z)           scanf("%d %d %d",&(x),&(y),&(z))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          scln3(x,y,z)           scanf("%lld %lld %lld",&(x),&(y),&(z))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
//#define          input                  freopen("input.txt","rt", stdin)
//#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     acos(-1.0)
//#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Max(v)                 *max_element(all(v))
#define          Min(v)                 *min_element(all(v))
#define          Upper(c,x)             (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)             (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)              (X).erase(unique(all(X)),(X).end())
#define          no                     cout << "NO" << endl ;
#define          yes                    cout << "YES" << endl ;
#define          DBG                    cout << endl << "---------------" << endl ;
#define segment_tree int Lnode = node << 1 , Rnode = Lnode + 1 , mid = ( b + e ) >> 1 ;

///bool operator < ( const Node& p ) const{ return cost < p.cost ; }
///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
///string s = std::bitset<64>(n).to_string();
///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

vector < ll > v, v1, v2, v3, v4, v5, v6 ;
vector < pll > vec,vec1,vec2,vec3 ;
vector < ll > adj[ 26 ] ;
map < ll, ll > Mp, Mp1 ;
set < ll > st, st1 ;
queue < ll > Q ;
stack < ll > Stk ;
multiset < pll > S ;

ll n, m, T, t, q ;

void Reset()
{
    v1.clear() ;
}

void Input()
{
    cin >> n ;
    ll a ;
    for( int i = 0 ; i < n ; i ++ )
    {
        cin >> a ;
        v1.pb( a ) ;
    }
}

void Calculation()
{
    ll ans = 0, pos = 0, add = 0 ;
    for( int i = 1 ; i < n ; i ++ )
    {
        if( v1[ i ] < v1[ i - 1 ] )
        {
            add = 0 ;
            pos = 0 ;
            while( v1[ i ] < v1[ i - 1 ] )
            {
                v1[ i ] += v[ pos ] ;
                pos ++ ;
            }
            ans = max( ans, pos ) ;

            ll sum = 0 ;
            for( int j = v.size() - 1 ; j >= 0 ; j -- )
            {
                if( v1[ i ] - v[ j ] >= v1[ i - 1 ] )
                {
                    v1[ i ] -= v[ j ] ;
                }
            }
        }
    }
    cout << ans << endl ;
}

void solve()
{
    Reset() ;
    Input() ;
    Calculation() ;
}

int main()
{
    CIN ;
    ll val = 1 ;
    v.pb( val ) ;
    for( int i = 1 ; i < 63 ; i ++ )
    {
        val *= 2 ;
        v.pb( val ) ;
    }
    cin >> t ;
    while( t-- )
    {
        T ++ ;
        solve() ;
    }

    return 0 ;
}