#include <stdio.h> int main() { long n,max,sum,first,end,k,i; int x,t,o; scanf("%d",&t); o=t; while(t--) { scanf("%ld",&n); for( max=-9999,sum=0,k=1,i=1;i<=n;i++) { scanf("%d",&x); sum+=x; if(sum>max) {max=sum;first=k;end=i;} if(sum<0) {sum=0;k=i+1;} } if((o-t)!=1) printf("/n"); printf("Case %d:/n%ld %ld %ld/n",o-t,max,first,end); } system("pause"); return 0; }