Dice Betting

Compute the probability that at least k distinct values appear when an s-sided die is rolled n times, and print it to nine decimals.

Medium6ProbabilityDynamic programmingCombinatoricsMathNo attempts yetTime limit2sMemory limit512 MB

Problem

Gunnar and his friends like games that involve rolling dice. Gunnar owns a huge collection of 6-sided, 12-sided and 20-sided dice. Every dice game he knew had become boring, so he invented a new one. He rolls an ss-sided die nn times and wins if at least kk different numbers appear in those nn throws. An ss-sided die carries the numbers 11 to ss on its sides, one distinct number per side.

The game has a single player, so Gunnar and his friends made it more fun by letting other people bet on a round. Before you bet, you want to know how probable it is to throw at least kk different numbers in nn throws with an ss-sided die. Every number is equally likely on each throw.

Input

The only line contains three integers nn, ss and kk in this order (1n100001 \le n \le 10\,000, 1ks5001 \le k \le s \le 500). nn is the number of throws, ss is the number of sides of the die, and kk is the number of different numbers needed to win.

Output

Print one line with the probability that at least kk different numbers appear in nn throws of an ss-sided die. Round the value to nine digits after the decimal point and pad with zeros so that exactly nine digits follow the decimal point. A probability of 11 prints as 1.000000000 and a probability of 00 prints as 0.000000000.