Getting SIGSEGV error in MARBLEGF

I am repeatedly getting SIGSEGV error in MARBLEGF .The same problem when I am doing in C ,I am getting wrong answer.I have used segment tree to solve it.Can you please tell me what is the error in my code.
My code is :

CodeChef: Practical coding for everyone

for c++ solution
and
http://www.codechef.com/viewsolution/4339267

for c solution.

https://www.codechef.com/viewsolution/39080343

change from int to long long int … i too was in a fix due to this…

HAPPY Coding :slight_smile: