Source Code
#include <iostream>
#include <algorithm>
using namespace std;

int n = 1000001;

int main() {
  
  int a[n];
  int b[n];
  int Test;
  cin >> Test;
  
  while (Test>0){
      int numberOfParts;
      int ans=0;
      cin >> numberOfParts;
  for (int i = 0; i < numberOfParts;i++){
    cin>>a[i];
  }
  for (int i=0;i<numberOfParts;i++){
    cin>>b[i];
    ans = max (ans , b[i]-a[i]);
  }
  cout<< ans <<endl;
  Test--;
}

  return 0;
}
Copy
Garden Walls King_Of_Asgard
GNU G++17
176 ms
8.1 MB
Accepted