← Retour à l'épreuve

Kazakhstan FAIO 2024 · Énoncé

H. Meteorites with Gold

Mis en forme par IOAI Training à partir de l'original (BeksultanSagyndyk/faio-tasks, licence Apache-2.0). L'original fait foi.

https://contest.yandex.ru/contest/71291/problems/H/

Time limit: 1 second
Memory limit: 64 MB
Input: standard input or input.txt
Output: standard output or output.txt

The gravitational matrix is working perfectly! Every minute, it pulls one meteorite toward the station for research and for finding gold. There are x meteorites around the station in total, and exactly g of them contain gold. Meteorites are pulled in one by one. What is the expected number of minutes until a meteorite with gold is pulled in?

Input
Two natural numbers x and g separated by a space.
Constraints: 0 < g <= x < 100000.

Output
Print the answer as a decimal fraction (floating-point number).

Sample Input

1 1

Sample Output

1