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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt;
    cin >> tt;
    while(tt--)
    {
        int n,op=0;
        cin >> n;
        int wall[n],chil[n];
        for(int i = 0;i<n;cin >> wall[i++]);
        for(int i=0;i<n;cin >> chil[i++]);
        for(int i= 0;i<n;i++)
        {
            op=max(op,chil[i]-wall[i]);
        }
        cout << op << endl;
    }
    return 0;
}
Copy
Garden Walls Mohamedmaher
GNU G++17
41 ms
2.4 MB
Accepted