#include<bits/stdc++.h> usingnamespace std; typedefdouble dnt; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } dnt f[50][10][10][10]; voidinit(){ for (int i = 0; i < 49; i++) for (int a = 0; a <= 7; a++) for (int b = 0; b <= 7-a; b++) for (int c = 0; c <= 7-a-b; c++) { dnt p = 1.0/(a+b+c+1.0); f[i+1][a][b][c] += (f[i][a][b][c]+1.0)*p; if (a) f[i+1][a][b][c] += f[i][a-1][b][c]*a*p; if (b && a+b+c < 7) f[i+1][a][b][c] += f[i][a+1][b-1][c+1]*b*p; if (b && a+b+c >= 7) f[i+1][a][b][c] += f[i][a+1][b-1][c]*b*p; if (c && a+b+c < 7) f[i+1][a][b][c] += f[i][a][b+1][c]*c*p; if (c && a+b+c >= 7) f[i+1][a][b][c] += f[i][a][b+1][c-1]*c*p; } } intmain(){ int T; read(T), init(); while (T--) { int n, a, b, c; read(n), read(a), read(b), read(c); printf("%.2lf\n", f[n][a][b][c]); } return0; }