Source Code
#include <iostream>
using namespace std;
int main() {
  int t;
  cin>>t;
  for(int i=0;i<t;i++){
    int c=0;
    int n;
    cin>>n;
    int a[n];
    int b[n];
     for(int k=0;k<n;k++){
       cin>>a[k];
       cin>>b[k];
       int s=b[k]-a[k];
         if(s>c){
           c=s;}
        
       }
     cout<<c<<endl;}

  
    
     
  return 0;
       }
Copy
Garden Walls dalia tamimi
GNU G++17
2 ms
184 KB
Wrong Answer