#include <stdio.h> #include <math.h> using namespace std; int main(){ int n,v1,v2,t; while( ~(scanf("%d%d%d%d", &n, &v1, &v2,&t))){ if( v2>v1 ){ printf("NO\n"); }else{ //v1>v2 float time = 1.0*n*1000/fabs(v1-v2); if( time > t ){ printf("NO\n"); }else{ printf("%.02f\n", time ); } } } return 0; } |
Double click to view unformatted code.