Score : $100$ points
In a certain programming contest, T-shirts are awarded to participants according to the following rules.
There were $1000$ participants in this contest, and all of them got different ranks.
Iroha-chan, who participated in this contest, ranked $X$-th.
Find the probability that she gets a T-shirt.
Input is given from Standard Input in the following format:
$A$ $B$ $C$ $X$
Print the answer. Your output will be considered correct if the absolute or relative error from the judge's answer is at most $10^{−6}$.
30 500 20 103
0.042553191489
Iroha-chan ranked $103$-rd.
She will get a T-shirt if she is among the $20$ participants chosen uniformly at random from the $470$ participants who ranked between $31$-st and $500$-th, which happens with probability $\frac{20}{470}=0.04255319\dots$.
50 500 100 1
1.000000000000
Iroha-chan ranked $1$-st. This time, she is guaranteed to get a T-shirt.
1 2 1 1000
0.000000000000
Iroha-chan ranked $1000$-th. This time, she will never get a T-shirt.