Runtime error SIGSEGv

My code runs perfectly fine on the system, both geany(ied) and terminal. I even checked for the standard input output format, reading the inputs from a file and directing them to another output file. HOwever when I upload it on codechef, it gives a runtime error SIGSEGV. Ive tried every possible thing.
Pl Help!

the question CAOS1 is in a currently ongoing contest.please ask after the contest is over. for reference please read this faq about SIGSESV