#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef pair <int, int> PII;
const int MaxN=1200;

int n;
double k[MaxN],c[MaxN];
double sk;

int main(){
    int t,cas=0;
    scanf("%d",&t);
    while (t--){
        scanf("%d",&n);
        sk=0;
        for (int i=0; i<n; i++){
            scanf("%lf",k+i);
            sk+=k[i];
        }
        for (int i=0; i<n; i++) scanf("%lf",c+i);
        double rst=(1+n)/sk;
        printf("Case #%d: %.6lf\n",++cas,rst);
    }
    return 0;
}