The lead game (TLG) solution error

I am just teaching myself C++ programming and I was wondering if someone could critique this solution and tell me why it gives a wrong answer. For small solutions it gives the correct answers in my tests, but it gives a wrong answer when submitted. Any suggestions?

#include <iostream>
using namespace std;
int main () {
	int N=0;
	cin >> N;
	int i=0, winner=0, lead=0, P1s=0, P2s=0;
	while (i < N) {
		cin >> P1s >> P2s;
		if (lead < (P1s-P2s)) {
			winner = 1;
			lead = (P1s-P2s);
		}
		else if (lead < (P2s-P1s)) {
			winner = 2;
			lead = (P2s-P1s);
		}
		i++;
	}
	cout << winner << " " << lead << endl;
	return 0;
}

your approach is wrong…
read the question again. test case misleads you.

HINT : you need to get some other answer if you shuffle the same test case.!!
observe carefully the case solved in question description.

yeah…
apply some other logic…
wrong approach.

focus on overall lead score

Your output must consist of a single
line containing two integers W and L,
where W is 1 or 2 and indicates the
winner and L is the maximum lead
attained by the winner.

there L is maximum overall lead, but it needs to be calculated per round