// {In the Name of Allah, the Most Beneficent, the Most Merciful }
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
#define mp make_pair
#define pb push_back
#define pf push_front
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);
#define no cout<<"NO\n"
#define yes cout<<"YES\n"
#define el "\n"
int a[200005] , b[200005] ;
int main()
{
/**/IOS/**/
int t ;
cin>>t;
while(t--)
{
int n , z=0;
cin>>n;
for(int i=0 ; i<n ; i++)
cin>>a[i];
for(int i=0 ; i<n ; i++)
{
cin>>b[i];
if(a[i]<=b[i])
z=max(z,(b[i]-a[i]));
}
cout<<z<<el;
}
}//main
Copy