EOOPR - Editorial

Hey Brother,
You cannot change a and b.
Either you can do 2+7+7 (if a = 7) or you can do 2+1+1 (if a = 1 )
You can refer this explanation - Click Here

Why is it wrong??

https://www.codechef.com/viewsolution/39569192

#include
using namespace std;

int main() {
long long t;
cin>>t;
while(t){
long long x,y,pd;
cin>>x>>y;
if(x==y){
std::cout << β€œ1” << std::endl;
}
else if(y>x){
pd=y-x;
if(pd%2==0){
if((pd/2)%2==0){
cout<<β€œ3”;
}
else if((pd/2)%2!=0){
cout<<β€œ2”;
}
}
else
std::cout << β€œ1” << std::endl;
}
else if(y<x){
pd=y-x;
if(pd%2==0){
cout<<β€œ1”;
}
else
std::cout << β€œ2” << std::endl;
}

    t--;
}
return 0;

}

What is wrong in this code ?

am javaScript developer. jest today opened CodeChef . How to Start it. and Where to find solutions in JS code. plz help me.

Hi, anyone please tell me why did we use the difference between the X and Y. Because I am not to get this question like this my first question here.

1 Like

bro i am geting EOF error, even though i am using the editorial code. how to correct it

why i am getting EOF error with this solution, even i used the same code.

You can visit the problem and go to β€œall submissions” , then select you language and search.

let me check the solution.Send your solution link.

You can refer this explaination - Click Here