View Code of Problem 104

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

Double click to view unformatted code.


Back to problem 104