// IO #include #include #include #include // algorithm #include #include #include // container #include #include #include #include #include #include #include #include #include // others #include #include #include #include #include // type alias using lint = long long; using ldouble = long double; template using greater_priority_queue = std::priority_queue, std::greater>; /* ----- class ----- */ template struct Edge { int from, to; Cost cost; Edge(int from = -1, int to = -1, Cost cost = 1) : from(from), to(to), cost(cost){}; bool operator<(const Edge& e) const { return this->cost < e.cost; } bool operator>(const Edge& e) const { return this->cost > e.cost; } }; template using Edges = std::vector>; template class Graph { public: int size; std::vector>> path; explicit Graph(int N = 0) : size(N), path(size) {} void span(int from, int to, Cost cost = 1) { path[from].push_back(Edge(from, to, cost)); } std::vector>& operator[](int v) { return path[v]; } }; /* ----- Output Functions for Debugging ----- */ template std::ostream& operator<<(std::ostream& os, std::vector v); template std::ostream& operator<<(std::ostream& os, std::set v); template std::ostream& operator<<(std::ostream& os, std::pair p); template std::ostream& operator<<(std::ostream& os, std::map v); template std::ostream& operator<<(std::ostream& os, std::stack s); template std::ostream& operator<<(std::ostream& os, std::queue q); template std::ostream& operator<<(std::ostream& os, std::priority_queue q); template std::ostream& operator<<(std::ostream& os, std::priority_queue, std::greater> q); template std::ostream& operator<<(std::ostream& os, Edge e); template std::ostream& operator<<(std::ostream& os, std::vector v) { os << "["; for (auto vv : v) os << vv << ","; return os << "]"; } template std::ostream& operator<<(std::ostream& os, std::set v) { os << "{"; for (auto vv : v) os << vv << ","; return os << "}"; } template std::ostream& operator<<(std::ostream& os, std::pair p) { return os << "(" << p.first << "," << p.second << ")"; } template std::ostream& operator<<(std::ostream& os, std::map v) { os << "{"; for (auto vv : v) os << vv << ","; return os << "}"; } template std::ostream& operator<<(std::ostream& os, std::stack s) { os << "["; while (!s.empty()) { os << s.top() << ","; s.pop(); } return os << "]"; } template std::ostream& operator<<(std::ostream& os, std::queue q) { os << "["; while (!q.empty()) { os << q.front() << ","; q.pop(); } return os << "]"; } template std::ostream& operator<<(std::ostream& os, std::priority_queue q) { os << "{"; while (!q.empty()) { os << q.top() << ","; q.pop(); } return os << "}"; } template std::ostream& operator<<(std::ostream& os, std::priority_queue, std::greater> q) { os << "{"; while (!q.empty()) { os << q.top() << ","; q.pop(); } return os << "}"; } template std::ostream& operator<<(std::ostream& os, Edge e) { return os << "(" << e.from << "->" << e.to << ":" << e.cost << ")"; } /* ----- Short Functions ----- */ template inline T sq(T a) { return a * a; } template inline T iceil(T n, T d) { return (n + d - 1) / d; } template T gcd(T a, T b) { while (b > 0) { a %= b; std::swap(a, b); } return a; } template T ipow(T b, U n) { T ret = 1; while (n > 0) { if (n & 1) ret *= b; n >>= 1; b *= b; } return ret; } // 0-indexed template inline T kthbit(T a, U k) { return (a >> k) & 1; } template inline T mask(T a, U k) { return a & ((1 << k) - 1); } template std::map compress(std::vector& v) { std::sort(v.begin(), v.end()); v.erase(std::unique(v.begin(), v.end()), v.end()); std::map rev; for (int i = 0; i < v.size(); ++i) rev[v[i]] = i; return rev; } template T Vec(T v) { return v; } template auto Vec(size_t l, Ts... ts) { return std::vector(ts...))>(l, Vec(ts...)); } /* ----- Constants ----- */ // const int INF = std::numeric_limits::max() / 3; // const ll INF = std::numeric_limits::max() / 3; // const ldouble PI = acos(-1); const ldouble EPS = 1e-10; // std::mt19937 mt(int(std::time(nullptr))); int main() { std::cout << std::fixed << std::setprecision(10); int N; ldouble p, q; std::cin >> N >> p >> q; if (p < EPS || 1 - p < EPS) { std::cout << p << std::endl; return 0; } ldouble ans = p; for (int i = 0; i < N - 1; ++i) { ans = ans * sq(q) / (1 - p * ans) + p; } std::cout << ans << std::endl; return 0; }