/**
* Linear-time maximum contiguous subsequence sum algorithm.
*/
int maxSubSum4(const vector<int> & a)
{
int maxSum=0,thisSum=0;
for( int j=0;i<a.size();j++)
{
thisSum+=a[j];
if(thisSum>maxSum)
maxSum=thisSum;
else if( thisSum < 0 )
thisSum=0;
}
retrun maxSum;
}