why is it giving runtime error ?

the link of my solution is as follows

http://www.codechef.com/viewsolution/3475358

//