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

#define  fast        ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define  endl        '\n'
#define  loop(i,n)     for(int i=0; i<n; ++i)
#define  trav(a,b)   for(auto &a:b)
#define  brec(n)     fixed<<setprecision(n)
#define  YES         cout << "YES"<<endl;
#define  NO          cout << "NO" << endl;
#define TC            int t; cin >> t; while(t--)
#define asort(a,n)            sort(a,a+n)
#define dsort(a,n)            sort(a,a+n,greater<>())
#define vasort(v)           sort(v.begin(), v.end());
#define vdsort(v)           sort(v.begin(), v.end(),greater<>());

const int N = 2e5+5;

typedef long long ll;

int  arr[N], arr2[N];

using namespace std;

int main()
{
  fast

   TC
   {
       int n;
       cin >> n;
       for (int i=0 ; i<n ; ++i)
       {
           cin >> arr[i];

       }
       int maxDef =0;
       for (int i=0 ; i<n ; ++i)
       {

        cin >> arr2[i];
        maxDef = max( (arr2[i] - arr[i]), maxDef );

       }

       cout << maxDef << endl;


   }

    return 0;
}
Copy
Garden Walls amin_2020
GNU G++17
73 ms
1.8 MB
Accepted