Update MaxSumOnSegment