#include <iostream> #include <math.h> using namespace std; int main(){ double n,v1,v2,t,time,s; while(scanf("%lf%lf%lf%lf",&n,&v1,&v2,&t)!=EOF){ s = v1-v2; if(s*t<(n*1000)) printf("NO\n"); else printf("%.2lf\n",n*1000/s); } return 0; } |
Double click to view unformatted code.