Why does it show runtime error??

(code edited by @cyberax for the reason given by @ritesh_gupta :

the poster is invited to post again when the contest is ended.)

@amalaray:: The solution that you posted is the solution of one of the problem From the Live Contest going on at codechef.Even though its incorrect solution,don’t repeat it.Such an act leads to suspension of account .Refer the guidelines http://discuss.codechef.com/questions/855/what-kind-of-comment-should-i-post-on-the-problem-page.