Source Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
const int N = 2e5 + 10, NN = 1e6;
const int mod = 7 + 1e9;
const ll oo = 1e9;
double eps = 1e-9;

void Ifyoufailtryagain(){
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for(int &i:a) 
    cin >> i;
  for(int &i:b) 
    cin >> i;
  int mx = 0;
  for(int i=0; i<n; ++i){
    mx = max(mx, b[i] - a[i]);
  }
  cout << mx << '\n';
  return;
}

int main()
{
  ios::sync_with_stdio(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  int t = 1;
  cin >> t;
  while (t--)
    Ifyoufailtryagain();
}
Copy
Garden Walls fortyfive
GNU G++17
53 ms
1.9 MB
Accepted