CHEFHACK RUNTIME ERROR (SIG SEGV)

my code gives sigsegv error on submission. Please help my code is here CodeChef: Practical coding for everyone
thanx

Would you paste it into pastebin.com and give us the link.
It would be much more readable.
Thanks.

the link for my solution on pastebin is here