Source Code
#include<iostream>
#include<vector>

using namespace std;

int main(){

    int t;
    cin >> t;

    while(t--){
        int n;
        cin>>n;
        vector<int> a(n), b(n);
        for(auto&x: a){
            cin >> x;

        }
        for(auto&x:b){
            cin >> x;
        }
        int mx = 0;
        for(int i = 0; i < n;i++){
            int res = b[i] - a[i];

            if (mx < res){
                mx = res;
            }
        }
        cout << mx << '\n';

    }
    return 0;

}
Copy
Garden Walls iyaad
GNU G++17
235 ms
1.8 MB
Accepted