← All problemsSign in

Candy Lottery

CSESMathematicsOpen on judge ↗

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 The only input line contains two integers n and k. Output Print the expected number rounded to six decimal places (rounding half to even). Constraints - 1 \le n \le 100 - 1 \le k \le 100 Example Input: 2 3 Outpu

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start