QOJ.ac

QOJ

時間限制: 5.0 s 記憶體限制: 1024 MB 總分: 100

#14420. This Time I Will Be Lucky

统计

In a casino, there is a bag with $a$ white balls and $b$ black balls. Until the bag is empty, we can pick one ball randomly from the bag, and if it is white, we gain $1$ dollar; otherwise, we lose $1$ dollar. After that, we trash this ball. We can stop at any time, including the time before picking any balls. What maximum expected profit can we get?

Input

The input contains two space-separated integers, $a$ and $b$ ($0 \le a, b \le 100\,000$).

Output

Print one real number: the maximum expected profit. The answer will be considered correct if the absolute or relative error is at most $10^{-6}$.

Examples

Sample Input 1

0 0

Sample Output 1

0

Sample Input 2

3 4

Sample Output 2

0.342857142857142857

Sample Input 3

2 2

Sample Output 3

0.666666666666666666

Sample Input 4

3 0

Sample Output 4

3

Note

Don't forget setprecision if you use C++.

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.