runtime error sigsegv

plz check where i am using array out of bounds?? solution is http://www.codechef.com/viewsolution/6357091
for question http://www.codechef.com/problems/SUMTRIAN/