Help me in solving HOTEL problem

My issue

the question not clear can anyone clear me the process or explain the testcases

My code

#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define vs vector<string> 
#define mii map<int, int>
#define mci map<char,int>
#define si set<int>
#define sc set<char>
#define endl '\n'
#define ia(n) int a[n]
#define iton for(int i=0;i<n;i++)
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld; 


void solve(){
    int n;
    cin>>n;
    ia(n);
    int b[n];
    iton{
        cin>>a[i];
    }
    iton{
        cin>>b[i];
    }
    cout<<b[n-1]-a[n-1]<<endl;
    
}


int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }

}

Problem Link: Hotel Bytelandia Practice Coding Problem

@anon52430226
plzz refer my c++ code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    int a[n],d[n];
	    map<int,int> mp;
	    for(int i=0;i<n;i++)
	    {
	        cin>>a[i];
	    }
	    for(int i=0;i<n;i++)
	    {
	        cin>>d[i];
	        for(int j=a[i];j<d[i];j++)
	        {
	            mp[j]++;
	        }
	    }
	    int ans=0;
	    for(auto x:mp)
	    {
	        ans=max(ans,x.second);
	    }
	    cout<<ans<<endl;
	}
	return 0;
}

but i am not able to understand the question correctly and btw thanks for the correct code now i understood it can you please also guide me for 4 star which topics are more important in codechef