I don’t understand why mine solution is wrong for problem: NUMCOMP Problem - CodeChef
my solution:
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
int a,b,n;
cin>>a>>b>>n;
if(a==b){
cout<<“0\n”;
}
if(a>=0 && b>=0)
{
if(a>b)
cout<<"1\n";
else
cout<<"2\n";
}
else if(a<=0 && b<=0)
{
if(n%2==0){
if(a<b)
cout<<"1\n";
else
cout<<"2\n";
}
else{
if(a>b)
cout<<"1\n";
else
cout<<"2\n";
}
}
else{
if(n%2==0){
if(a<0)
a=-a;
else
b=-b;
if(a>b)
cout<<"1\n";
else
cout<<"2\n";
}
else{
if(a>b)
cout<<"1\n";
else
cout<<"2\n";
}
}
}
return 0;
}