View Code of Problem 104

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

int main(){
	int n,v1,v2,t;
	double a;
	while(scanf("%d%d%d%d",&n,&v1,&v2,&t))
	{
		a=1.0*n*1000/fabs((v1-v2));
		if(a<=t)
			printf("%0.2f\n",a);
		else
			printf("NO\n");	
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 104