#include "bits/stdc++.h" using namespace std; void solve() { int n; cin >> n; double p, q; cin >> p >> q; vector> dp(2, vector(n+2, 0)); dp[0][1] = 1; double ans = 0; int reptimes = 1000000; while(reptimes--) { vector> nx(2, vector(n+2, 0)); for (int i = 1; i <= n; i++) for (int j = 0; j < 2; j++) { nx[j^1][i-1] += dp[j][i] * p; nx[j^1][i+1] += dp[j][i] * q; } ans += nx[1][0]; swap(dp, nx); } cout << fixed << setprecision(9) << ans << endl; } int main() { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }