maxsum alg.

follow compiler segmentation fault