You are not logged in. Please login at www.codechef.com to post your questions!

×

# include<iostream>

using namespace std; long long int w,b; 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;


}

asked 13 Dec '18, 22:28 1
accept rate: 0%

 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

question asked: 13 Dec '18, 22:28

question was seen: 51 times

last updated: 13 Dec '18, 22:28