题解:P16349 「Gensokyo OI Round 1」坊巷逸闻

· · 题解

Solution

一道数学推导题,不难的,题目甚至贴心的给出了形式化题意。

由题目可以得出:

::::info[推导过程] ![](https://cdn.luogu.com.cn/upload/image_hosting/9bqu36vt.png) :::: 根据题目给出的数据带入即可,注意要使用 `long long`。 ## AC Code ```cpp #include <iostream> #include <iomanip> using namespace std; int main() { long long a, b, c; cin >> a >> b >> c; double ans = 1.0 * a * c / (b + c); cout << fixed << setprecision(9) << ans << endl; return 0; } ```