QOJ.ac

QOJ

Límite de tiempo: 5.0 s Límite de memoria: 1024 MB Puntuación total: 100

#14420. This Time I Will Be Lucky

Estadísticas

あるカジノに、白いボールが $a$ 個、黒いボールが $b$ 個入った袋があります。袋が空になるまで、袋から無作為に 1 個のボールを取り出すことができます。取り出したボールが白であれば $1$ ドルを獲得し、そうでなければ $1$ ドルを失います。その後、そのボールは破棄します。ボールを 1 個も取り出す前を含め、任意の時点で終了することができます。得られる利益の期待値の最大値はいくらでしょうか?

入力

入力は空白で区切られた 2 つの整数 $a$ と $b$($0 \le a, b \le 100\,000$)からなります。

出力

利益の期待値の最大値を表す 1 つの実数を出力してください。絶対誤差または相対誤差が $10^{-6}$ 以下であれば正解とみなされます。

入出力例

入力例 1

0 0

出力例 1

0

入力例 2

3 4

出力例 2

0.342857142857142857

入力例 3

2 2

出力例 3

0.666666666666666666

入力例 4

3 0

出力例 4

3

ノート

C++ を使用する場合は setprecision を忘れないでください。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.