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

· · 题解

解题思路

已知梯形 ABCDFCD 中点。设 AE=x,利用面积相等 S_{AEFC}=S_{BEFD} 列方程。化简得 ans=\frac{(a \times c)}{(b+c)}。 ::::success[AC Code]

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long a, b, c;
    scanf("%lld %lld %lld", &a, &b, &c);
    double ans = (double)(a * c) / (b + c);
    printf("%.9f\n", ans);
    return 0;
}

::::