#include #include #include using namespace std; using i64 = long long; using decimal = long double; double solve1(i64 n, i64 l, i64 r) { vector dp(6*n+1); dp[0] = 1; for(int i=0; i ndp(6*n+1); for(int summ=i; summ<=6*i; ++summ) { if(dp[summ] < 1e-15) { continue; } for(int curr=1; curr<=6; ++curr) { ndp[summ+curr] += dp[summ] / 6; } } dp = ndp; } double res = 0; for(i64 i=l; i<=r; ++i) { res += dp[i]; } return res; } decimal f(decimal x, decimal u, decimal v) { return (1 + erfl((x - u)/sqrtl(2*v))) / 2; } decimal solve2(i64 n, i64 l, i64 r) { decimal u = decimal(7) * n / 2, v = decimal(35) * n / 12, deno = sqrtl(v), half = decimal(1) / 2; return f(decimal(r) + half, u, v) - f(decimal(l) - half, u, v); } int main(void) { i64 n, l, r; scanf("%lld%lld%lld", &n, &l, &r); l = max(n, l); r = min(6*n, r); double res; if(n < 5000) { res = solve1(n, l, r); } else { res = solve2(n, l, r); } printf("%.15lf\n", res); return 0; }