题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5761
题意:一个人开小船从(0, a)出发,水流速度一直沿x正方向为v2,小船本身速度方向一直朝原点,大小v1,问开到原点用时多少。
妈的数学题,积分,小船不过河去什么原点啊。
公式不会推,到现在也没弄明白。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
int a, v1, v2;
while(~scanf("%d %d %d", &a, &v1, &v2)) {
if(a < 1) puts("0");
else if(v2 >= v1) puts("Infinity");
else printf("%lf\n", 1.0 * a * v1 / (v1 * v1 - v2 * v2));
}
return 0;
}