#include #include #include #include #include #include using namespace std; int N; double P, Q; double dp[1010]; int main() { cin >> N >> P >> Q; if (N == 1) { printf("%.15f\n", P); return 0; } dp[N - 1] = Q; for (int i = N - 2; i >= 0; i--) { dp[i] = P + Q * dp[i+1] * Q / (1 - dp[i+1]*P); } printf("%.15f\n", dp[0]); }