Not getting desired output

what conditions i am missing. please debug it.
link to my code - https://ide.codingblocks.com/s/253072

@pulkit_pandey09
your code was correct, you were not printing a new line after each tc.

not getting correct output corresponding to sample input. debug it please.

@pulkit_pandey09
And also abs was missing.
I have made he changes in your code please check.