#P6026. Disjoint Order Intervals

    ID: 19250 Type: Default 1000ms 256MiB

Disjoint Order Intervals

Disjoint Order Intervals

In a restaurant, there are (n) special dishes labeled (1,2,\ldots,n). One day, (k) guests arrive without knowing what to order. The waiter suggests a procedure: each guest first randomly picks an integer (r) uniformly from (1,2,\ldots,n); then they pick an integer (l) uniformly from (1,2,\ldots,r). The guest then orders all dishes with labels between (l) and (r) (inclusive). After all the guests have ordered, the waiter is amazed to find that no dish is ordered by two or more guests – that is, the sets of dishes ordered by different guests are pairwise disjoint. To show how lucky he is, he asks you to calculate the probability of this event occurring.

More formally, for each guest, an interval ([l,r]) is chosen with probability (\frac{1}{n}\cdot\frac{1}{r}) (for (1\le l\le r\le n)). Let (I_i=[l_i,r_i]) be the interval chosen by guest (i). The event is that for any two distinct guests (i) and (j), (I_i\cap I_j = \emptyset). Compute the probability that this holds.

inputFormat

The input consists of a single line containing two integers (n) and (k) (with (1\le k\le n)), where (n) is the total number of dishes and (k) is the number of guests.

outputFormat

Output a single line containing the probability that no two guests’ orders share any common dish. The answer should be printed as a floating point number with at least 9 decimal places of precision.

sample

3 2
0.333333333