Untitled

 avatar
unknown
c_cpp
6 months ago
444 B
9
Indexable
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
    cout.setf(ios::fixed);
    cout.precision(15);
    int C, M, F;
    cin >> C >> M >>F;
    if (M > C) {
        cout << 1.0;
        return 0;
    }
    if (M <= 1e6) {
        long double ans= 1;
        for (int k = 0; k < M; ++k)
            ans *= 2 * (C - k) / (long double)(2 * C - k);
        cout << 1 - ans;
    } else {
        cout << 1.0;
    }
}
Editor is loading...
Leave a Comment