FOR THIS QUESTIONTHE LEAD GAME

I AM GETTING A WA

HERE IS MY CODE PLEASE POINT OUT THE MISTAKES AND EXPLAIN YOUR SOLUTION

#include<bits/stdc++.h>

using namespace std;

#define ll int

int main()

{

ll n;

cin>>n;

ll s[n],t[n],a[n];

ll i;

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

cin>>s[i];

cin>>t[i];

```
}
ll w=0;
for(i=0;i<n;i++){
a[i]=s[i]-t[i];
}
ll k=*max_element(a,a+n);
ll j;
for(i=0;i<n;i++){
if(k==a[i])
j=i;
}
if(s[j]>t[j]){
cout<<1<<" ";
cout<<a[j]<<endl;
}
else{
cout<<2<<" ";
cout<<a[j]<<endl;
}
```

return 0;

}

THANKS IN ADVANCE