#include#include #include #define min(a,b) ((a)<(b)?(a):(b)) const int N = 50005; int t, n; double a, c; double cal(int i, double a) { return c + log(a) - (n - 1) * log(2); } int main() { int cas = 0; scanf("%d", &t); while (t--) { scanf("%d", &n); double sum = 0; c = 0; for (int i = 0; i < n; i++) { scanf("%lf", &a); if (a < 0) sum -= exp(cal(i, -a)); else sum += exp(cal(i, a)); c = c + log(n - i - 1) - log(i + 1); } printf("Case #%d: %.3lf\n", ++cas, sum); } return 0; }