#include #include #include using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i=i##_begin_;i--) #define REP(i, n) FOR(i,0,n) #define IREP(i, n) IFOR(i,0,n) double dp[51][51][51][51]; int main() { int A, B, C, N; cin >> A >> B >> C >> N; dp[N][A][B][C] = 1; vector ret(3); IFOR(i, 1, N + 1) FOR(a, 1, A + 1) FOR(b, 1, B + 1) FOR(c, 1, C + 1) { double n = a + b + c; double paa = a * (a - 1) / (n * (n - 1)); double pbb = b * (b - 1) / (n * (n - 1)); double pcc = c * (c - 1) / (n * (n - 1)); double p0 = 1 - paa - pbb - pcc; dp[i - 1][a][b][c] += dp[i][a][b][c] * p0; dp[i - 1][a - 1][b][c] += dp[i][a][b][c] * paa; dp[i - 1][a][b - 1][c] += dp[i][a][b][c] * pbb; dp[i - 1][a][b][c - 1] += dp[i][a][b][c] * pcc; ret[0] += dp[i][a][b][c] * paa; ret[1] += dp[i][a][b][c] * pbb; ret[2] += dp[i][a][b][c] * pcc; } cout << fixed << setprecision(16) << ret[0] << ' ' << ret[1] << ' ' << ret[2] << '\n'; }