問題一覧 > 通常問題

No.1688 Veterinarian

レベル : / AI推定難易度 : 1200 / 実行時間制限 : 1ケース 3.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 147
作問者 : ansain / テスター : LayCurse ygussany
お気に入りにしたユーザー ProblemId : 6537 / 自分の提出
問題文最終更新日: 2021-09-06 00:49:38
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 315 (順位表) の他の問題:

Problem Statement

A bag contains $A$ white chips, $B$ black chips, and $C$ brown chips.
You repeat the following operation $N$ times.  

  • Take out $2$ chips from the bag at random (every pair of $2$ chips is chosen with equal probability). If the $2$ chips are the same color, you obtain $1$ of them and put the other $1$ chip back into the bag. Otherwise, put all $2$ chips back into the bag.
  • What is the expected number of chips of each color that you finally obtain?

    Input

    $A$ $B$ $C$ $N$

  • $1 \le A,B,C,N \le 50$
  • All inputs are integers.
  • Output

    Print the expected number of chips of each color that you finally obtain, separated by spaces, in the order white, black, brown. Your answer is considered correct if the absolute or relative error from the correct value is at most $10^{-6}$.

    Sample

    Sample 1
    Input
    3 2 1 1
    
    Output
    0.2 0.06666666666666667 0.0

    In $1$ operation, the probability of obtaining a white chip is ${}_3\mathrm{C}_2/{}_6\mathrm{C}_2=1/5$.
    The probability of obtaining a black chip is ${}_2\mathrm{C}_2/{}_6\mathrm{C}_2=1/15$.
    There is no possibility of obtaining a brown chip.

    Sample 2
    Input
    1 1 1 50
    Output
    0.0 0.0 0.0

    No matter how many operations you perform, you never obtain a chip.

    Sample 3
    Input
    4 3 2 13
    Output
    1.7966653641138075 1.0669842436070012 0.4428093340194705
    

    The expected values are, respectively,
    $3452192328044966520392806880021097467/1921444247213913479420805120000000000$
    $1171514706712320746421671594290613233/1097968141265093416811888640000000000$
    $5105000684786014790930854501796258921/11528665483283480876524830720000000000$
    .

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。