View Code of Problem 104

#include <stdio.h>

int main(){
	int n,v1,v2,t;
	while(scanf("%d %d %d %d",&n,&v1,&v2,&t)!=EOF){
		if(v1-v2<=0){
			printf("NO\n");
		}else{
			double t1 = (double)n*1000/(v1-v2);
			if(t1<t){
				printf("%.2f\n",t1);
			}else{
				printf("NO\n");
			}
		}
	}
}

Double click to view unformatted code.


Back to problem 104