Problem AL
Ticket Lottery
The lottery operates as follows. First, everyone interested enters the lottery. Then, $n$ lucky winners are drawn, and each of these is offered to buy up to $t$ tickets.
Given the number of people $p$ in your group (all of which entered the lottery) and the total number of people $m$ that entered the lottery, what is the probability that you will be able to get tickets for your entire group? Assume that the $n$ lucky winners are chosen uniformly at random from the $m$ people that entered the lottery, and that each person can win at most once.
Input
The input consists of a single line containing four integers:
-
$1 \le m \le 1000$: the total number of people who entered the lottery.
-
$1 \le n \le m$: the total number of winners drawn.
-
$1 \le t \le 100$: the number of tickets each winner is allowed to buy.
-
$1 \le p \le m$: the number of people in your group.
Output
Output a single line containing the probability that your entire group can get tickets to the show. This probability should be given with an absolute error of at most $10^{-9}$.
Sample Input 1 | Sample Output 1 |
---|---|
100 10 2 1 |
0.1 |
Sample Input 2 | Sample Output 2 |
---|---|
100 10 2 2 |
0.1909090909 |
Sample Input 3 | Sample Output 3 |
---|---|
10 10 5 1 |
1.0000000000 |