#include #include #include #include #include #include #include #include #include #include #include #include #include #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define var auto #define mod 1000000007 #define inf 2147483647 #define nil -1 typedef long long ll; using namespace std; inline int input(){ int a; cin >> a; return a; } template inline void output(T a, int p) { if(p){ cout << fixed << setprecision(p) << a << "\n"; } else{ cout << a << "\n"; } } // end of template int main() { cin.tie(0); // source code ll N, L, R; cin >> N >> L >> R; R = min(R, 6 * N); double p = 1.0 / 6; if (N <= 2000) { vector tmp(6 * N + 1), dp(6 * N + 1); tmp[0] = 1; rep(i, N){ dp.assign(6 * N + 1, 0); rep(j, 6 * N + 1){ repd(k, 1, 7){ dp[j + k] += tmp[j] * p; } } tmp = dp; } double ret = 0; for (ll i = L; i <= R; i++) { ret += dp[i]; } output(ret, 15); } else{ double mu = 7.0 / 2 * N; double sigma = 35.0 / 12 * N; double ret = 1.0 / 2 * (erf((R + 0.5 - mu) / sqrt(2 * sigma)) - erf((L - 0.5 - mu) / sqrt(2 * sigma))); output(ret, 15); } return 0; }