#include <bits/stdc++.h>
#define ll long long
#define rt(x) return cout<<x,0;
#define all(x) x.begin(),x.end()
#define youssif ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
using namespace std;
ll arr[100005],arrr[100005];
int main()
{
youssif
ll x=100,y,z,a=0,b,i,j,t,cur=0;
static int idx=1;
char aa,bb;
string s,ss;
cin>>t;
while(t--)
{
cin>>x;
for(i=0;i<x;i++)
{
cin>>arr[i];
}
ll mx=INT_MIN;
for(i=0;i<x;i++)
{
cin>>z;
mx=max(mx,z-arr[i]);
}
cout<<mx<<endl;
}
return 0;
}
/*
*/
Copy