Source Code
#include <iostream>
using namespace std;
int main()
{
	int n, t;
	cin >> t;
	long bi, tmp;
	long ai[200001];
	while (t--)
	{
		tmp = 0;
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> ai[i];
		}
		for (int i = 0; i < n; i++)
		{
			cin >> bi;
			if (tmp < bi - ai[i])
				tmp = bi - ai[i];
		}
		cout << tmp << endl;
	}
	return 0;
}
Copy
Garden Walls master2000
GNU G++17
148 ms
1.8 MB
Accepted