Source Code
#include <iostream>
using namespace std;

int main(){
    
	int t;
	cin>>t;
	
	while(t--){
		int n;
		    cin>>n;
		
		int a[n];
		for(int i=0;i<n;i++){
			cin>>a[i];
		}
   		
   		int b[n];
   		for(int i=0;i<n;i++){
			cin>>b[i];
		}

		int minimum_operation = 0;
		
		for(int i=0;i<n;i++){
			if(a[i]<b[i]){
				int required_increase = (b[i] - a[i]);
				minimum_operation = max(minimum_operation,required_increase);
			}
		}
		cout<<minimum_operation<<endl;
	}
	return 0;
}
Copy
Garden Walls khawaja
GNU G++17
179 ms
1.8 MB
Accepted