6862.Dice Probability

Time Limit: 1s Memory Limit: 512MB

You throw a dice $n$ times, and every throw produces an outcome between $1$ and $6$ . What is the probability that the sum of outcomes is between $a$ and $b$ ?

Input Format(From the terminal/stdin)

The only input line contains three integers $n$ , $a$ and $b$ .

  • $1 \le n \le 100$
  • $1 \le a \le b \le 6n$

Output Format(To the terminal/stdout)

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

Sample Input

Copy
2 9 10
 · ·  \n

Sample Output

Copy
0.194444
        \n
Source: CSES, Mathematics, 1725

Submit

请先 登录

© 2025 FAQs