WHY CODE CHEF COMPILER IS GIVING WRONG ANSWER FOR THE FOLLOWING CODE ,THOUGH WHEN I'M COMPILING IT ON DEV C++ 5.11 COMPILER IT'S PRODUCING THEDESIRED OUTPUT??

#include
using namespace std;
int main()
{
int a,o,k,t,i,diff;
cin>>t;
for(i=1;i<=t;i++)
{
cin>>a>>o>>k;
if(a>o)
{
diff=a-o;
if(diff>=k)
{
o+=k;
cout<<a-o<<endl;
}
else
{
o+=diff;
k=k-diff;
if(k%2==0)
cout<<0<<endl;
else
cout<<1<<endl;
}
}
else if(o>a)
{
diff=o-a;
if(diff>=k)
{
a+=k;
cout<<o-a<<endl;
}
else
{
a+=diff;
k=k-diff;
if(k%2==0)
cout<<0<<endl;
else
cout<<1<<endl;
}
}
else
{
if(k%2==0)
cout<<0<<endl;
else
cout<<1<<endl;
}
}

return 0;

}
Comments

@mohit121 first of all compiler has no role on correctness of a program(just make sure you dont make any compile time errors though) it all depends on your algorithm and when you test your program you will do so for 1 or 2 inputs but a ONLINE JUDGE considers all possibilities where your code can break so just test your code thoroughly and use ideone for sharing your code. As of now plz share problem code so that anyone can try to find a bug in your program

//