/*
sample input
3
-1 -2 -3
6
0 1 0 1 0 1
4
-1 0 -1 1
sample output
0 0
1 3
1 1
*/
#include <iostream>
using namespace std;
int main() {
int test, z = 1, s;
int n, ans, i;
int da;
bool f;
scanf("%d", &test);
while(test --) {
ans = 0; f = false; s = 0;
scanf("%d", &n);
for(i = 0; i < n; ++ i) {
scanf("%d", &da);
if(da > 0 || da == 0 && f) {
s += da;
if(!f) {
f = true;
ans ++;
}
}
else if(da < 0 || da == 0 && !f){
f = false;
}
}
printf("Case %d:\n", z ++);
printf("%d %d\n", ans, s);
if(test) puts("");
}
return 0;
}