SIGSEGV in MINOPS

can anybody help me to remove this SIGSECV runtime error in my code.
and explain when to use long long int, long int,int in c++

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