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 :

for c++ solution

for c solution.

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

HAPPY Coding :slight_smile: