atcoder#ABC242A. [ABC242A] T-shirt
[ABC242A] T-shirt
Score : points
Problem Statement
In a certain programming contest, T-shirts are awarded to participants according to the following rules.
- All participants who ranked -th or higher get a T-shirt.
- Additionally, from the participants who ranked between -th and -th (inclusive), participants chosen uniformly at random get a T-shirt.
There were participants in this contest, and all of them got different ranks. Iroha-chan, who participated in this contest, ranked -th. Find the probability that she gets a T-shirt.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer. Your output will be considered correct if the absolute or relative error from the judge's answer is at most .
30 500 20 103
0.042553191489
Iroha-chan ranked -rd. She will get a T-shirt if she is among the participants chosen uniformly at random from the participants who ranked between -st and -th, which happens with probability .
50 500 100 1
1.000000000000
Iroha-chan ranked -st. This time, she is guaranteed to get a T-shirt.
1 2 1 1000
0.000000000000
Iroha-chan ranked -th. This time, she will never get a T-shirt.