Happy Tourism (Codegoda 2022)

Правка en1, от Neeraj_Kumar_Coder, 2022-08-08 13:09:15

Statement

It's the world tourism day and agoda has launched a special promocode with each hotel booking a person makes, they can get a cashback randomly and uniformly distributed from the range [1, maxCashback] in integer USD. A person will start with 0 cashback and can keep applying this promocode until they secure a minimum of M USD in total across all his future bookings.
To keep the customers happy, Agoda wants to ensure that majority of people can make atleast H USD from this promocode.
Find the probability of a customer being not happy (total cashback < H) with this promocode. Given M, maxCashback, H.

Constraints

0 <= M <= H <= 1e4
1 <= maxCashback <= 1e4

Output

The calculated probability

SAMPLE TEST CASE

1 10 6

OUTPUT

0.50000
Теги codegoda, probability, mathematics

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Neeraj_Kumar_Coder 2022-08-08 13:09:15 945 Initial revision (published)