View Code of Problem 104

#include<stdio.h>
#include<math.h>
int main(){
	int n;
	int v1,v2,t;
	double t1,n1;
	while(scanf("%d",&n)!=EOF){
	
		scanf("%d %d %d",&v1,&v2,&t);	
		if(v1<=v2){
			printf("NO\n");
		}else{
			n1=1000.0*n;
			t1=n1/(v1-v2);
			if(t1>t){
				printf("NO\n");	
			}else{
				printf("%.2f",t1);
			}
		
		}


}
	return 0;
}

Double click to view unformatted code.


Back to problem 104