Problem Code- EOOPR
CODE :
#include
#include
using namespace std;
int check(int a){
if (a%2==0){
return 1;
}
else
return 0;
}
int main() {
int t;
cin >> t;
while(t!=0){
int x, y, k;
cin >> x >> y;
k=y-x;
if(k>0){
if (check(k)==1){
cout << "2";
}
else
cout << "1";
}
if (k<0){
k=abs(k);
if(check(k)==1){
cout << "1";
}
else {
cout << "2";
}
}
if (k==0){
cout << "0";
}
printf("\n");
--t;
}
return 0;
}
given input is satisfying then why wrong answer