#include <iostream>
using namespace std;
int main() {
int t,n;
cin >> t;
for(int i=0;i<t;i++){
cin >> n;
int wall[n];
int children[n];
int dif[n];
for(int i=0;i<n;i++){
cin>>wall[i];
}
for(int i=0;i<n;i++){
cin>>children[i];
}
int max=children[0]-wall[0];
for(int i=0;i<n;i++){
dif[i]=children[i]-wall[i];
}
for(int i=0;i<n;i++){
if(max<dif[i])
max=dif[i];
}
cout<<max<<endl;
}
}