Source Code
#include <bits/stdc++.h>

using namespace std;

const int N=2e5+5;

int n;
int a[N],b[N];

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		int ans=0;
		for(int i=0;i<n;i++)
			scanf("%d",&a[i]);
		for(int i=0;i<n;i++)
		{
			scanf("%d",&b[i]);
			ans=max(ans,b[i]-a[i]);
		}
		printf("%d\n",ans);
	}
}
Copy
Garden Walls mahmoudbadawy
GNU G++17
84 ms
1.7 MB
Accepted