题意:
给出a,v1,v2。 a是 在y轴上的位置 ,v1船速,v2,水流速度
路程是这样的,然后对x轴方向,y轴方向分别积分会有:
对 dy/dt= v2*cosθ-v1
dx/dt=v2-v1*cosθ
然后分别0 -T积分,最后会得出
T= a*v1 / (v2*v2-v1*v1)
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int a,v1,v2;
while(~scanf("%d%d%d",&a,&v1,&v2))
{if(a==0)
{
printf("0\n");
}
else if(v1<=v2)
{
cout<<"Infinity"<<endl;
}
else
printf("%lf\n",1.0*a*v1/(v1*v1-v2*v2));
}
return 0;
}