This is the problem of an ongoing contest.
You are not even supposed to discuss about the problems of an ongoing contest but you have posted the code.
I suggest that you please read the rules and regulations(the first point) on the contest page carefully.
I suggest that you please edit this post and remove the code.
As far as the wrong answer is concerned, we will be happy to help you after the contest gets over.
Feel free to post any doubts about this question after the contest, we will help you out.