View Code of Problem 104

#include<stdio.h> 
#include<string.h>
#include<math.h>

int main(){
    int i,n,v1,v2,t;
    float time;
    while(~scanf("%d%d%d%d",&n,&v1,&v2,&t)){
    	if(v1>v2){
    		time=1000.0*n/(v1-v2);
    		if(time>t) printf("NO\n");
    		else printf("%.2f\n",time);
		}
		else printf("NO\n");
	}
    return 0; 
     
}

Double click to view unformatted code.


Back to problem 104