Pls Help me with this code, Why is it not working?

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

my code is not accepted please review it

my code is not accepted please see it

# cook your dish here

T=int(input())

list1=[]

list2=[]

for i in range (T):

A,B=map(int,input().split())

if A>B:

a=(A-B)

list1.append(a)

else:

b=(B-A)

list2.append(b)

a=max(list1)

b=max(list2)

if a>b:

print(â€ś1â€ť,a)

else:

print(â€ś2â€ť,b)

Please either format your code or (better!) link to your submission - the forum software has mangled it and it wonâ€™t compile!

Also - what Problem are you trying to solve?

Thanks

**My Solution is not being accepted.** Can please someone tell me whatâ€™s wrong with my code

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

what is the problem with my code, please help and thanks in advance.

#include

#include

#include

#include <bits/stdc++.h>

#include

#include

using namespace std;

// return 0;

int main()

{

int T,a[100000],b[100000],x[100000],counter=0 ;

```
// int x;
// float y;
// cin>>x>>y;
cin>>T;
// cin>>k;
for (int i = 0; i < T; i++)
{
cin>>a[i];
cin>>b[i];
}
for (int i = 0; i < T; i++)
{
if (a[i] > b[i])
{
x[i] = a[i] -b[i];
// cout<<"1 "<<x[i]<<endl;
}
else
{
x[i] = b[i] -a[i];
// cout<<"2 "<<x[i]<<endl;
}
}
sort(x, x+T, greater<int>());
for (int i=0;i<T;i++)
{
if (a[i] - b[i] == x[0])
{
cout<<"1 "<<x[0]<<endl;
break;
}
else
{
cout<<"2 "<<x[0]<<endl;
break;
}
}
return 0;
```

}

```
import math
lead = []
winner=0
for i in range (int(input())):
a,b = map(int,input().split())
lead.append(a-b)
if max(lead)>abs(min(lead)):
print(1, max(lead))
else:
print(2, abs(min(lead)))
```

it gives the expected output but i am not able to submit it