Archi and comparison giving wrong answer

this below code is giving wrong answer

link to the question

#include<iostream>
#include<cstdio>
#include<cmath>
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);


using namespace std;

int main()
{
	FAST_IO
int T;
long long int a,b,n;
cin>>T;
while(T--)
{
	cin>>a>>b>>n;

if ((a>=0 && b>=0))
{
	if(a>b)
		cout<<"1"<<"\n";
	else if(a<b)
		cout<<"2"<<"\n";
	else
		cout<<"0"<<"\n";

}


if ((a>=0 && b<=0))
{
	if(!(n%2))
		b=-b;
	
	if(a>b)
		cout<<"1"<<"\n";
	else if(a<b)
		cout<<"2"<<"\n";
	else
		cout<<"0"<<"\n";

}

if ((a<=0 && b>=0))
{
   if(!(n%2))
	   a=-a;
	
	if(a>b)
		cout<<"1"<<"\n";
	else if(a<b)
		cout<<"2"<<"\n";
	else
		cout<<"0"<<"\n";

}

if ((a<=0 && b<=0))
{
   if(!(n%2))
	   {
	   b=-b;
	   a=-a;
	   }
	if(a>b)
		cout<<"1"<<"\n";
	else if(a<b)
		cout<<"2"<<"\n";
	else
		cout<<"0"<<"\n";
	
	

}




}

    return 0;
}


Your code is printing multiple lines for single case

1 Like

nevermind, you solved it!

Enter this:
1
0 0 1
And see the magic.