题目:http://acm.hdu.edu.cn/showproblem.php?pid=1003
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
int count = cin.nextInt();
int mCase=1;
while(count!=0){
int len = cin.nextInt();
int maxSum=-1001,thisSum=0;
int start=0,end=0;
int tempIndex=0;
for(int i=0;i<len;i++){
thisSum+=cin.nextInt();
if(thisSum>maxSum){
maxSum=thisSum;
start=tempIndex;
end=i;
}//end if
if(thisSum<0){
tempIndex=i+1;
thisSum=0;
}//end if
}//end for
System.out.println("Case "+mCase+":");
System.out.println(maxSum+" "+(start+1)+" "+(end+1));
mCase++;
count--;
if(count!=0){
System.out.println();
}
}//end while
}
}