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