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