problem qestion The Lead Game what is wrong in my code

game
lead
problem
solve
the

#1

#include
using namespace std;
#include

int main(){
long int no,a;
cin>>no;
 long int roundp1[no];
long int roundp2[no];
long int lead[no];
long int maxi1=0;
long int maxi2=0;
for (a=0;a<no;++a){


    cin>>(roundp1[a])>>(roundp2[a]);
    lead[a]=roundp1[a] - roundp2[a];
    if (lead[a]>0){
                    if (lead[a]>maxi1){
            maxi1=lead[a];
        }
    }
    if ( lead[a]<0){
        if ( (abs(lead[a])>maxi2) ){
            maxi2=abs(lead[a]);
        }
    }
    if (lead[a]==0){
        lead[a]=0;
    }
}
if (maxi1>maxi2){
       int winp=1;
    cout<<winp<<maxi1;

}
if (maxi1<maxi2){
    int winp=2;
    cout<<winp<<maxi2;
    }
return 0;
}

#2

The lead of each round is CUMULATIVE SUM OF LEad of previous round+Lead in this round.

For example-

Take 3 rounds,

 A     B
    100  60. Lead= 100-60 = 40 for A
    50   80 . Lead= 40(earlier lead of of player A) - (80-50)(Lead of player B)= 10 for A and NOT 30 for B.
    10   90. Lead = 90-10-10 = 70 for B