runtime error sigsegv

plz check where i am using array out of bounds?? solution is CodeChef: Practical coding for everyone
for question SUMTRIAN Problem - CodeChef