Codeforces Round #327 (Div. 2) A Wizards' Duel (水题)

简单的物理问题,x = pt, y = l - qt。令x == y解出t,然后得出相遇位置。

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;


//#define LOCAL
int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    int l, p, q; scanf("%d%d%d",&l,&p,&q);
    double ans = (double)l/(p+q)*p;
    printf("%lf",ans);
    return 0;
}
原文地址:https://www.cnblogs.com/jerryRey/p/4909914.html