#include #include #include #include using namespace std; vector>>>> mem; vector f(int n, int a, int b, int c){ if(n == 0 || a+b+c <= 1) return {0.0, 0.0, 0.0}; if(mem[n][a][b][c][0] >= 0.0) return mem[n][a][b][c]; mem[n][a][b][c] = {0.0, 0.0, 0.0}; double z = (a+b+c)*(a+b+c-1); double y = z; y -= a*(a-1) + b*(b-1) + c*(c-1); vector v = {a, b, c}; for(int i = 0; i < 3; i++){ if(v[i] < 2) continue; v[i]--; auto res = f(n-1, v[0], v[1], v[2]); res[i] += 1.0; for(int j = 0; j < 3; j++) mem[n][a][b][c][j] += res[j]*(v[i]+1)*v[i]/z; v[i]++; } auto res = f(n-1, a, b, c); for(int i = 0; i < 3; i++) mem[n][a][b][c][i] += res[i]*y/z; return mem[n][a][b][c]; } int main(){ int a, b, c, n; cin >> a >> b >> c >> n; mem = vector>>>>(55, vector>>>(55, vector>>(55, vector>(55, vector(3, -1))))); vector ans = f(n, a, b, c); for(int i = 0; i < 3; i++){ cout << fixed << setprecision(10) << ans[i] << " \n"[i == 2]; } return 0; }