Source Code
//
//  main.cpp
//  to be Better
//
//  Created by Malek Alsadi.
//

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
const ll MAX = 5e5;
const ll MOD = 1e9+ 7;
ll GCD(int a,int b){ return (b==0)?a: GCD(b,a%b);}
ll LCM(int a,int b){ return(a*b)/GCD(a, b);}
ll fastPower(ll x, ll p) {
   if (p == 0)                 return 1;
   if (p == 1)                 return x;
   if (p % 2 == 1) return (x*fastPower(x, p-1));
   ll r = fastPower(x, p / 2);
   return (r*r);
}

void magic(){
    int n ; cin >> n;
    vector < int > v1(n);
    for(auto &X : v1)
        cin >> X ;
    vector < int > v2(n);
    for(auto &X : v2)
        cin >> X ;
    int diff = 0;
    for(int i(0);i<n;++i){
        diff = max (diff , v2[i] - v1[i] );
    }
    cout << diff;
}


int main() {
   ios_base::sync_with_stdio(0);
   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;
   while(t--)
       magic(),cout<<'\n';
   return 0;
}
Copy
Garden Walls Malek
GNU G++17
77 ms
1.9 MB
Accepted