QOJ.ac

QOJ

Time Limit: 5.0 s Memory Limit: 1024 MB Total points: 100

#14420. This Time I Will Be Lucky

Statistics

In un casinò c'è un sacchetto con $a$ palline bianche e $b$ palline nere. Finché il sacchetto non è vuoto, possiamo estrarre casualmente una pallina dal sacchetto: se è bianca, guadagniamo $1$ dollaro; altrimenti, perdiamo $1$ dollaro. Dopodiché, buttiamo via questa pallina. Possiamo fermarci in qualsiasi momento, incluso prima di estrarre qualsiasi pallina. Qual è il massimo profitto atteso che possiamo ottenere?

Input

L'input contiene due interi separati da spazio, $a$ e $b$ ($0 \le a, b \le 100\,000$).

Output

Stampa un numero reale: il massimo profitto atteso. La risposta sarà considerata corretta se l'errore assoluto o relativo è al massimo $10^{-6}$.

Esempi

Input di esempio 1

0 0

Output di esempio 1

0

Input di esempio 2

3 4

Output di esempio 2

0.342857142857142857

Input di esempio 3

2 2

Output di esempio 3

0.666666666666666666

Input di esempio 4

3 0

Output di esempio 4

3

Nota

Non dimenticare setprecision se usi 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.