#include<stdio.h> #include<string.h> #include<math.h> int main(){ double n,v1,v2,t; while(scanf("%lf%lf%lf%lf",&n,&v1,&v2,&t)){ double time; if(v1>v2){ time=1000*n/(v1-v2); if(time>t)printf("NO"); else printf("%.2lf",time); } else printf("NO"); } } |
Double click to view unformatted code.