Cannot pass all the test cases

i’ve thought of everything and tried everything but unable to pass the test case 4 and 5

Save your code on ide.codingblocks.com and share its link.

In place of long use long long and then check.

Hi I used long long and the code was still not working. But then instead of using “pow” for finding the square of ‘a’ I simply did a*a and all the test cases passed, further more the test cases and now passing even using long. Can you explain to me why is this happening. This is very intresting.

pow actually works on double and return a double result. This may be a possibility of wrong answer due to pow.
Go through this article

I can see that your submission was accepted. So marks your doubt as resolved if it is so

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.