Source Code
#include <iostream>
using namespace std;

int main() {
  int t,n;
  cin >> t;
  for(int i=0;i<t;i++){
  cin >> n;
  int wall[n];
  int children[n];
  int dif[n];
  for(int i=0;i<n;i++){
    cin>>wall[i];
  }
   for(int i=0;i<n;i++){
    cin>>children[i];
  }
  int max=children[0]-wall[0];
  for(int i=0;i<n;i++){
      dif[i]=children[i]-wall[i];
  }
  for(int i=0;i<n;i++){
    if(max<dif[i])
      max=dif[i];
   }
    cout<<max<<endl;
 }
}
Copy
Garden Walls OmarQuishawi
GNU G++17
175 ms
296 KB
Wrong Answer