Alice begins at 0 points.
She repeatedly draws points while her score is less than k.
Each draw gives her a random integer from 1 to maxPts (inclusive), with each outcome equally likely.
Once Alice reaches k or more points, she stops drawing.
Your task is to compute the probability that her final score is less than or equal to n.
Your output should be precise within 1e-5 of the correct answer.
Input: n = 5, k = 1, maxPts = 5
Output: 1.00000
Explanation:
Alice draws once and is guaranteed to have at most 5 points. Example 2:
Input: n = 8, k = 2, maxPts = 4
Output: 0.75000
Explanation:
There are 3 favorable score outcomes out of 4 equally likely draws.
Input: n = 25, k = 15, maxPts = 10
Output: 0.72800
Explanation:
The probability depends on all possible reachable sums before exceeding the limit.
Accepted:
Submission: