what are the reasons for the wrong answer

Even though answer is correct while executing in (code,compile,run) but shows wrong answer after submission.

Your code is not giving correct answer on every test case that why it is showing wrong answer. Try running your code with corner test cases.

Even if your program logic is correct, it may still show WA if there is an overflow occurring somewhere

Write your code here. We will review it. !

Hey Champ9, you can refer to the similar question we have here: Why do I get Wrong Answer? - faq - CodeChef Discuss