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

int n = 1000001;

int main() {
  int ans=0;
  int a[n];
  int b[n];
  int Test, numberOfParts;
  cin >> Test;
  cin >> numberOfParts;
  while (Test>0){
  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]);
  }
  Test--;
  cout<< ans <<endl;
}

  return 0;
}
Copy
Garden Walls King_Of_Asgard
GNU G++17
10 ms
8.0 MB
Wrong Answer