#D. increment of coins

    Type: Default 1000ms 256MiB

increment of coins

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[ABC184D] increment of coins

题目描述

袋子里原本有金币 AA 枚、银币 BB 枚、铜币 CC 枚。

直到袋子中有一种硬币达到 100100 枚之前,都会进行以下操作。

操作:每秒钟都有 11 枚硬币被等概率地取出,然后向袋子中放入两枚相同的硬币。

求出操作次数的数学期望。

输入格式

一行三个整数 A,B,CA,B,C

输出格式

一行一个浮点数,为操作次数的数学期望。若与标准答案的误差不超过 10610^{-6},则视为正确答案。

样例 #1

样例输入 #1

99 99 99

样例输出 #1

1.000000000

样例 #2

样例输入 #2

98 99 99

样例输出 #2

1.331081081

样例 #3

样例输入 #3

0 0 1

样例输出 #3

99.000000000

样例 #4

样例输入 #4

31 41 59

样例输出 #4

91.835008202

数据范围

  • 0  A,B,C  990\ \leq\ A,B,C\ \leq\ 99
  • A+B+C  1A+B+C\ \geq\ 1

样例解释1

不论第一次操作取出哪种硬币,袋中都会出现 100100 枚该种硬币。

样例解释2

我们只会在第一次取出金币的情况下进行第二次操作,操作次数的数学期望为 $2\times\ \frac{98}{98+99+99}+1\times\ \frac{99}{98+99+99}+1\times\ \frac{99}{98+99+99}=1.331081081\ldots$。

样例解释3

每次操作只会取出铜币。

20241029集训

Not Attended
Status
Done
Rule
IOI(Strict)
Problem
6
Start at
2024-10-29 19:00
End at
2024-10-29 21:00
Duration
2 hour(s)
Host
Partic.
16