6864.Candy Lottery

Time Limit: 1s Memory Limit: 512MB

There are $n$ children, and each of them independently gets a random integer number of candies between $1$ and $k$ .

What is the expected maximum number of candies a child gets?

Input Format(From the terminal/stdin)

The only input line contains two integers $n$ and $k$ .

  • $1 \le n \le 100$
  • $1 \le k \le 100$

Output Format(To the terminal/stdout)

Print the expected number rounded to six decimal places (rounding half to even).

Sample Input

Copy
2 3
 · \n

Sample Output

Copy
2.444444
        \n
Source: CSES, Mathematics, 1727

Submit

请先 登录

© 2025 FAQs