int maxsubsum(int a,int left,int right)
{
int sum=0;
if(left==right)sum=a[align=left]>0 ? a[align=left]:0;
else{
int center=(left+right)/2;
int leftsum=maxsubsum(a,left,center);
int rightsum=maxsubsum(a,center+1,right);
int s1=0,left=0;
for(int i=center;i>=left;i--){
left+=a[i];
if(lefts>s1)s1=lefts;
}
int s2=0,rights=0;
for(int i=center+1;i<=right;i++){
rights+=a[i];
if(lefts>s2)s2=rights;
}
sum=s1+s2;
if(sum<leftsum) sum=leftsum;
if(sum<rightsum) sum=rightsum;
}
return sum;
}
{
int sum=0;
if(left==right)sum=a[align=left]>0 ? a[align=left]:0;
else{
int center=(left+right)/2;
int leftsum=maxsubsum(a,left,center);
int rightsum=maxsubsum(a,center+1,right);
int s1=0,left=0;
for(int i=center;i>=left;i--){
left+=a[i];
if(lefts>s1)s1=lefts;
}
int s2=0,rights=0;
for(int i=center+1;i<=right;i++){
rights+=a[i];
if(lefts>s2)s2=rights;
}
sum=s1+s2;
if(sum<leftsum) sum=leftsum;
if(sum<rightsum) sum=rightsum;
}
return sum;
}
String me = "program"