#include<bits/stdc++.h>
#include<queue>
#define IOS ios::sync_with_stdio(false)
#define CT cin.tie(NULL)
#define Ct cout.tie(NULL)
#define f first
#define s second
#define l_queue priority_queue <int,vector<int>,greater<int> >
#define p_queue priority_queue <int>
inline void read(int& a){int s1=0,w=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-') w=-1;ch=getchar();}while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}a=s*w;}
void write(int x){if(x<0) putchar('-'),x=-x;if(x>9) write(x/10);putchar(x%10+'0');}
using namespace std;
int a,s,n,ans,cnt,gys;
int c(int x,int y,int z){
return x*y+z;
}
int _c(int x,int y){
return x*y;
}
signed main(){
IOS;CT;Ct;
read(n);
for(int i=1;i<=n;i++){
read(s);
ans=1;cnt=0;
for(int j=1;j<=s;j++){
read(a);
cnt=c(cnt,a,ans);
ans=_c(ans,a);
gys=__gcd(ans,cnt);
ans/=gys;cnt/=gys;
}
ans*=s;
gys=__gcd(ans,cnt);
ans/=gys;
cnt/=gys;
printf("Case ");
write(i);
printf(": ");
write(ans);
putchar('/');
write(cnt);
putchar('\n');
}
return 0;
}