What's wrong?

`#include<bits/stdc++.h>
using namespace std;
#define MAX(A,B) (A > B)? A:B;

int main(){

int t;
cin>>t;

int p1 = 0, p2 = 0, lead1 , lead2 ,max_lead1 = 0,max_lead2 = 0;

for (int i  = 0; i < t; i++) {
	int x,y;
	scanf("%d%d", &x,&y );

	p1 += x;
	p2 += y;
	if (p1 > p2) {
		lead1 = p1-p2;
		max_lead1 = MAX(max_lead1,lead1);  //compares the current lead and the updates lead and then updates.
//cout<<max_lead1<<"\n";
}
	else
	lead2 = p2-p1;
	max_lead2 = MAX(max_lead2,lead2);
	 //compares the current lead and the updates lead and then updates.
}
if (max_lead1 > max_lead2) {
	std::cout << "1" <<" "<<max_lead1<< '\n';
		}
else
std::cout << "2" <<" "<<max_lead2<< '\n';

}