why wrong answer???Spam classification using neural network

#include
using namespace std;
long long int w[100000],b[100000];
int main(){

short int t;
cin>>t;
long long int nspam=0,spam=0;
while(t--){
    long int n;
    long long int minx,maxx;
    cin>>n>>minx>>maxx;
    
    long long int total=maxx-minx+1;
    int out=(minx)%10,out1=out+1;
    for(long int i=0;i<n;i++){
        cin>>w[i]>>b[i];
        w[i]=w[i]%2;
        b[i]=(b[i]-1)%2+1;
        out=w[i]*out+b[i];
        out1=w[i]*out1+b[i];
        out=(out-1)%10+1;
        out1=(out1-1)%10+1;
        
    }
    
    if((out%2)==0&&out1%2==0){
        nspam=total;}
    else if(out%2==0){
    nspam=(total-1)/2+1;
    spam=total-nspam;
    }
    else if(out1%2==1&&out%2==1){
    spam=total;}
    else{
    spam=(total-1)/2+1;
    nspam=total-spam;
    }
    
    cout<<nspam<<" "<<spam;
}
return 0;

}

//