#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 if( fabs(v1-v2)*t < n*1000 ){ printf("NO\n"); }else{ float time = 1.0*n*1000/fabs(v1-v2); printf("%.02f\n", time ); } } } return 0; } |
Double click to view unformatted code.