#include<stdio.h> #include <math.h> void main() { float n,v1,v2,t; while(scanf("%f %f %f %f",&n,&v1,&v2,&t)!=EOF) { double t1; if(n==0) printf("0.00\n"); else { if(v1<=v2) printf("NO\n"); else { t1=n*1000/(v1-v2); if(t1>t) { printf("NO\n"); } else printf("%.2f\n",t1); } } } } |
Double click to view unformatted code.