← All problemsSign in

Dice Probability

CSESMathematicsOpen on judge ↗

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 The only input line contains three integers n, a and b. Output Print the probability rounded to six decimal places (rounding half to even). Constraints - 1 \le n \le 100 - 1 \le a \le b \le 6n Example Input: 2 9 10 Output: 0.194444

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