Source Code
#include <iostream>
using namespace std;

int n;
void solve(){
	cin>>n;
	int a[n],b[n];
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<n;i++) cin>>b[i];	
	
	int max=0;
	for(int i=0;i<n;i++){
		int dif=b[i]-a[i];
	//	cout<<a[i]<<"-"<<b[i]<<"="<<dif<<endl;
		if(dif>0 && dif>max) max=dif;
	}
	
	cout<<max<<endl;
}

int main() {
	int t;
	cin>>t;
	while(t--){

	solve();
	}
	return 0;
}
Copy
Garden Walls lianattily
GNU G++17
242 ms
1.8 MB
Accepted