SIGSEGV in STICKS problem?

Problem Code : Contest Page | CodeChef
My Solution : Solution: 67730636 | CodeChef

I know that this line is causing SIGSEGV issue

printf("%d\n",replic_arr[m-1]*replic_arr[m-2]);

but I did took care, that the array doesn’t go out of bounds, please help me figure out where my array goes out of bounds or SIGSEGV