https://www.codechef.com/viewsolution/26590349

anyone please explain whats wrong with my code as codechef is giving compilation error but working fine on codeblocks.

#include

#include<bits/stdc++.h>

#include<math.h>

using namespace std;

int main()

{

int a,b,s1=0,s2=0,t[2000];

long int n,i;

cin>>n;

for(i=0;i<n;i++)

{

cin>>a>>b;

s1=s1+a;

s2=s2+b;

t[i]=s1-s2;

}

sort(t,t+n);

```
if(abs(t[0])>t[n-1])
cout<<"2 "<<t[0];
else
cout<<"1 "<<abs(t[n-1]);
return 0;
```

}