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