Source Code
//
//<<<<<<<<<<<< Momen Ghazi Arafeh >>>>>>>>>>>>>>
//<<<< Don't wait the opportunity create it >>>>
//
#include <bits/stdc++.h>
using namespace std;

#define int             long long
#define endl            '\n'
#define cinL(v);         for(int i = 0; i < v.size(); i++) cin>>v[i];
#define print(v);        for(auto f : v ) cout << f << " " ;cout<<endl;
#define printP(v);       for(int i = 0; i < v.size(); i++)cout<<v[i].first<<v[i].second;
#define sortt(v);        sort(v.begin(),v.end());
#define sortr(v);        sort(v.rbegin(),v.rend());
#define debug(x);        cout<<"[" << #x << " is:" << x << "] "<<endl;
#define lcm(a,b)         ((a) * (b)) / __gcd((a), (b))

typedef pair <int,int> pii;

void solve() 
{
    int n; cin >> n;
    vector <int> a(n),b(n);

    cinL(a)
    cinL(b)
    int mx = 0;
    for (int i = 0; i < n; ++i)
    {
        mx = max(mx , b[i] - a[i]);
    }

    cout << mx << endl;

}
int32_t main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);   
    #endif
    
    int t = 1;  cin >> t;
    for (int i = 0; i < t; i++)
    {
        //cout << "Test " << i << endl; 
        solve(); 
    }
    return 0;
}

Copy
Garden Walls Momen-G-Ar
GNU G++17
71 ms
3.4 MB
Accepted