QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓

#18511. Apple and Cinnamon

통계

Alice is making a signature dessert that relies on a delicate harmony of two ingredients: apple and cinnamon. To achieve this, Alice reaches into a large, opaque canvas bag filled with flavor drops.

We know for certain that the bag contains at least $X$ apple drops and at least $Y$ cinnamon drops. However, there may be more drops of either flavor in the bag.

Among all possible final numbers of apple and cinnamon drops satisfying these lower bounds, Alice draws exactly two drops uniformly at random, without replacement. Alice's greatest hope is to draw one of each flavor, allowing apple and cinnamon to meet in a single trial dessert. Therefore, Alice wants to know the minimum possible probability of drawing two drops of the same flavor.

Input

The only line of the input contains two integers $X$ and $Y$ ($1 \le X,Y \le 10^9$) --- the minimum required number of apple drops and cinnamon drops in the bag, respectively.

Output

Print one real number --- the minimum possible probability that the two drawn drops have the same flavor.

Your answer will be considered correct if its absolute or relative error does not exceed $10^{-9}$.

Examples

Input 1

3 5

Output 1

0.44444444444444444444

Input 2

1 1

Output 2

0.00000000000000000000

Input 3

3971 1368

Output 3

0.49993703563782898879

Note

For the first test, if the bag contains $a$ apple drops and $b$ cinnamon drops, the probability of drawing two drops of the same flavor is $$ \frac{a(a-1)+b(b-1)}{(a+b)(a+b-1)}. $$ For $X=3$ and $Y=5$, one optimal choice is $(a,b)=(4,5)$, giving $\frac{4\cdot3+5\cdot4}{9\cdot8}=\frac49$.

For the second test, with $X=Y=1$, Alice can use exactly one drop of each flavor. Then every draw of two drops contains one of each flavor, so the probability of drawing two equal flavors is $0$.

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.