#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int n; cin >> n; double p, q; cin >> p >> q; double x[1002][2] = {}; x[0][0] = 1; x[n + 1][1] = 0; for (int i = 1; i <= n; i++) { x[i][0] = 0.5; } for (int h = 0; h < 100000; h++) { for (int i = 1; i <= n; i++) { x[i][0] = q * x[i - 1][0] + p * x[i + 1][1]; x[i][1] = p * x[i - 1][0] + q * x[i + 1][1]; } } printf("%.8f\n", x[1][1]); return 0; }