#include <iostream>
#include<string.h>
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
int t,n,s[100005],v[100005],maxx,cv,top=0;
cin>>t;
while(t--)
{
cin>>n;
cin>>s[0];
maxx=s[0];
v[0]=0;
cv=0;
for(int i=1; i<n; i++)
{
cin>>s[i];
if(s[i]+s[i-1]>=s[i])
{
s[i]=s[i-1]+s[i];
v[i]=v[i-1];
}
else
v[i]=i;
if(maxx<s[i])
{
maxx=s[i];
cv=i;
}
}
cout<<"Case "<<++top<<":"<<endl;
cout<<maxx<<" "<<v[cv]+1<<" "<<cv+1<<endl;
if(t!=0)
cout<<endl;
}
return 0;
}
hdu1003 动态更新