#include

using namespace std;

int arrive[1000];

int leave[1000];

int main()

{

```
int test,n,max,count;
cin>>test;
while(test--)
{ max=0;
cin>>n;
for(int i=0;i<n;++i)
{
cin>>arrive[i];
}
for(int i=0;i<n;++i)
{
cin>>leave[i];
}
for(int i=0;i<n;++i)
{
count=0;
for(int j=0;j<n;++j)
{
if (!(leave[j]<=arrive[i] or arrive[j]>=leave[i]))
{
++count;
}
if(count>max)
max=count;
}
}
cout<<count<<"\n";
}
return 0;
```

}