I tried to attempt the problem BEARSEG for 50 pts, but got SIGSEGV in the second sub-task. It would be a great help if somebody could pin-point where exactly was the SIGSEGV error occuring. Thank you.
SIGSEGV solution: solution
edit:I know why SIGSEGV occurs, I just want to know where is it occurring in my code.